Closed wheresrhys closed 9 years ago
Should we try CSSShrink then?
Otherwise this is a great point and it's easy to make sure it gets output once.
Here I explain how you can achieve @import-once
in pure Sass without any external dependency: https://github.com/thoughtbot/bourbon/issues/460#issuecomment-47750221. If it can help...
As discussed, at a product level it is now possible to only output the grid once and it should be done that way.
We'll revisit options if there are additional issues or when Sass 4.0 is out (with a proper import built-in system)
The majority of o-grid's output is wrapped in media queries, and css wrapped in media queries doesn't get de-duped by csso so e.g a typical site which includes the header and footer as well as its own site will have at least 3 copies of most of o-grid.
We did briefly explore faking
@import_once
in some way, but that was with sass 3.2. Now we're on 3.3 can we do something to make sure o-grid only outputs once?