dbisso / grunt-split-styles Goto Github PK
View Code? Open in Web Editor NEWGrunt task to pull certain styles into their own stylesheet.
License: MIT License
Grunt task to pull certain styles into their own stylesheet.
License: MIT License
When matching a pattern such as /^\.rtl/
against:
@media screen and (min-width: 50em) {
.rtl .thing {
color: red;
}
.another .thing {
color: blue;
}
}
Currently yields:
.rtl .thing {
color: red;
}
but we should have the option to include the parent media query node, giving us:
@media screen and (min-width: 50em) {
.rtl .thing {
color: red;
}
}
See #2 (comment)
@Extended selectors are being moved to the split stylesheet when they should be left behind.
In this example, I wish to move only .split-me
to split-me.css
:
// INPUT
// _demo.scss
%silent_shared {
color: red;
}
.split-me {
@extend %silent_shared;
}
.do-not-split-me {
@extend %silent_shared;
}
// main.scss
@import "demo";
// OUTPUT - expected
// main.css
.do-not-split-me {
color: red;
}
// split-me.css
.split-me {
color: red;
}
// OUTPUT - actual
// main.css
// empty
// split-me.css
.split-me, .do-not-split-me {
color: red;
}
Now you set from
and to
option only if source map is enabled. It is bad, because:
from
option to show syntax error messages.from
options.My config:
split_styles: {
rtl: {
options: {
pattern: /\.rtl/,
output: '_styles/main.rtl.css'
},
files: {
'_styles/main.css' : '_styles/main.css'
}
}
}
grunt --verbose outputs:
Files: _styles/main.css -> _styles/main.css
Options: separator="", pattern={}, remove, mediaPattern=false, unwrapMedia=false, output="_styles/main.rtl.css"
Looks like the pattern is not recognised.
The option 'matchParent' works perfectly when a parent media query is present, but ignores rules that do not have one.
Allow the 'output' option to be 'false'
Use case would be to strip rules from the css, but not create a new file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.