Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why isn't bless working? It is not splitting main css into multiple css files #43

Open
BryanBarrera opened this issue Oct 11, 2016 · 5 comments

Comments

@BryanBarrera
Copy link

Any help would be appreciated. I am trying to split up my main css stylesheet (specifically for ie9) it exceeds the number of lines that IE9 can handle and I want to add a grunt task which splits the main css sheet into however many it needs to.

I thought bless would solve this but I can't get it to work.

The task below simply just copies the main stylesheet 'foundation.css' into 'tmp/ie.css' - what am I doing wrong?

Here is how I have my task

bless: {
        css: {       
            options: {
                logCount: true, 
                compress: true,
                suffix: 'oldie'
            },
            files: [{ 
              src: 'css/foundation.css', // this is the main stylesheet
              dest: 'tmp/ie.css' // i was hoping bless would split the main stylesheet above into this sheet? how is it suppose to work?
          }] 
        }
    },
@AaronAsAChimp
Copy link
Member

Can you please provide the output of grunt with the --verbose --debug options, also please provide the output of grunt --version and node --version.

@BryanBarrera
Copy link
Author

Thanks for the quick reply!

Bless --verbose --debug

Running "bless:css" (bless) task
[D] Task source: /Users/Breezyy/Sites/devdesktop/l*******-dev/docroot/sites/all/themes/l*******_foundation/node_modules/grunt-bless/tasks/bless.js
Verifying property bless.css exists in config...OK
Files: css/foundation.css -> tmp/ie.css
Options: compress, logCount, force=false, warnLimit=4013, imports, failOnLimit, suffix="oldie", sourceMaps=false, root="", banner="/* this is a banner */"
Reading css/foundation.css...OK
>> ie has 3901 CSS selectors.
Found 3901 selectors, not splitting.
Writing tmp/ie.css...OK

grunt version

grunt-cli v1.2.0
grunt v1.0.1

node version
v6.6.0

@BryanBarrera
Copy link
Author

BryanBarrera commented Oct 11, 2016

The stylesheet has exactly 14,501 lines of CSS. I want to split this file up into 3 or how ever many files necessary for IE.

@AaronAsAChimp
Copy link
Member

I am not aware of IE having a limit on the number of lines. Bless (and grunt-bless) only splits files based on the number of selectors. You have 3901 selectors, bless splits every 4095.

@BryanBarrera
Copy link
Author

Hmm you're right. I thought it was after the 4,095th line, not rules/selectors. I was going off of this - https://support.microsoft.com/en-us/kb/262161 - I guess I misunderstood.

Is there an option or somehow in a future update to tell Bless what 'line number' we want the stylesheet to split at?

This would be extremely useful or nice to have as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants