Open gasolin opened 10 years ago
@gasolin that's definitely something we should start using! BTW: could it be possible when copying the BB to each app on build time do something like: https://github.com/giakki/uncss That would remove not used BB styles per app :)
@rnowm uncss sounds interesting for remove per app unused styles. It's another topic(but related to pre-processor) so I'd like to create a separate issue to track it.
requests can be fulfilled with https://github.com/gasolin/provecss
see imprt
testcases https://github.com/gasolin/provecss/tree/master/test/features
for case like https://github.com/mozilla-b2g/Gaia-UI-Building-Blocks/blob/v2/style/headers.css
ex:
headers.css
The PROS:
The CONS:
Fortunately we can fix it by use
pre-processor
to detect @import statement and inline the css files in production.There are some script like https://github.com/simme/rework-importer can interpret and inline all @import css into single file.
With pre-processor, the basic css file will be inlined to single
header.css
fileAnd we can pass some conditions for production mode, for example: pass
mobile
type to the build system, pre-processor could picklayout.css
andlayout_mobile.css
but ignorelayout_tablet.css
, generate an inlineheader.css
.The PROS:
The CONS:
@rnowm does this proposal reasonable or useful for Building-Blocks?