How to concat two SCSS and CSS Source Maps - source-maps

I am using sass to generate a source map which is output to a file. Then I generate a sourcemap for another CSS file using PostCSS. I am trying to concat both sourcemaps using applySourceMap in this sourcemap node module but it does work https://github.com/mozilla/source-map/blob/master/lib/source-map/source-map-generator.js
Does anyone know how to easily concat two source map files together?

Related

Include CSS file directly into template?

I've tried searching for how to include a CSS file directly into the template, but none of the answers are very good. I do not want to include the CSS file using <link>, I want to include it directly into the template. I also do not want to read the entire file into a variable and output the variable in the template.
I tried doing it like this
<style>{include "$ROOT_DIR/public/css/all.css}</style>
but then Smarty tries to parse it as a template, which obviously won't work because of the { and } in the CSS file.
I can't put {literal} ... {/literal} around the include, because then Smarty will just output the include command literally. And obviously I don't want to put the {literal} ... {/literal} in the CSS file, since it's not CSS.
I could read the file into a variable and output that in the template, but that seems like a very backwards way of doing things, and probably not very efficient.
Surely, there must be some way to include a file without parsing it as a template?!

fenced_divs pandoc extension in RMarkdown

Is there a way, either in YAML or within an R script/Rmd, to turn on the fenced_divs pandoc extension?
If possible, I would prefer being able to turn on fenced_divs without having to specify it inside each individual output format in the YAML block but rather once, globally.
The reason is that I want to have within-document links to items that are not headers using the same code for .docx and .html.
Thanks.

Copy map file on grunt with sass

I'm using usemin when building with grunt, and I use the following tasks on css: sass, concat, cssmin.
Is it possible to have a map file in the end in order to debug the code after it's built?
Thanks.
All these tasks support a map (usually through a sourceMap option), but it only maps their own output to their own input, so you would end up with at least 3 maps (if you manage to avoid naming conflicts):
one from minified css to concatenated css
one from concatenated css to separate css files
one from each css file to the original sass files
I understand you're looking for 1 map from the minified css to the original sass files, correct? Unfortunately, afaik there is no support for that in the tools.

Plugin for CKEditor split to multiple js files

I am creating a new CK Editor plugin, and want to split the javascript code to more than one .js file
Currently I do not see a way to load my second .js file.
My structure:
plugin.js --> this is the main file containing the plugin structure/code
manip.js --> contains text manipulation functions, that are called by the plugin (800+ lines)
Is this possible? What is your recommendation - put all code into plugin.js or would you also split code to two files?
Splitting your code makes sense only if it isn't required from the very beginning. E.g. CKEditor loads dialogs' code on demand and the same happens with paste from word filter. These files very often are big (>1k LOC) and it's not critical to load them at the beginning.
If you want to load your file on demand check this part of pastefromword plugin: https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/pastefromword/plugin.js#L95-L108
Here's the documentation: CKEDITOR.scriptLoader, CKEDITOR.getUrl.

Zurb Foundation multiple stylesheets (compass)

I've created a project with compass+foundation
I have multiple .scss on my page and I want to use foundation mixins in all of them.
If I do the import settings, import foundation. It copies all the settings in each files, which is taking a lot of unnecessary space. I'm sure I'm doing something wrong here.
If you need to use Foundation's mixins in your own scss files you should indeed use the #import directive. However you shouldn't import the foundation.scss file.
Sass has a naming convention for files that are meant to be imported
(called “partials”): they begin with an underscore.
Only import the partials you need (I would be surprised that you need every single one).
For example I needed to use the "css-triangle" mixin from _foundation-global.scss in one of my files.
MyStyles.scss
#import "../foundation/foundation-global"; (no need for the leading underscore)
.myClass{
#include css-triangle(5px, #fff, top);
}
I'm sure you have read this, but I'll put the link just in case.

Resources