Hello,
Similar to what was done here : https://www.drupal.org/node/2671148 I would like to know if there is currently a good option to disable loadCSS for specific roles. And if you would think that is an interesting thing.
It would be a good thing on my project since enabling loadCSS breaks admin menu and other admin things that might be rendered on the page, and are not things that I want to put in the criticalCSS for these users.
I could provide a patch for this. I will try to make that here in the next hours. But if there is already an option to do this I would like to know;p
Best regards
Joao Garin
Comment | File | Size | Author |
---|---|---|---|
#9 | advagg-2722443-8-mod-lists-static-fix.patch | 1.26 KB | mikeytown2 |
#4 | advagg-2722443-3-defer-css-alter.patch | 2.92 KB | mikeytown2 |
#2 | advagg-disable_defer_css_roles-2722443-2-7.x-2.x.patch | 2.03 KB | joaogarin |
Comments
Comment #2
joaogarin CreditAttribution: joaogarin commentedHere goes a little patch for this. Would be great to get some feedback on it;) Definitely need some way of doing this.
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedWhat about something that uses hooks instead of the UI. I've committed the attached patch. Example of it in action. This is essentially what you need; disable loadCSS if an unaccounted for css file is there.
Comment #5
joaogarin CreditAttribution: joaogarin commentedThat also looks like a really good solution! ;)
Comment #6
joaogarin CreditAttribution: joaogarin commentedI am going to try it out but it actually sounds like an even better option. maybe both are actually useful for some edge cases but either one will work for my case at least.
Sounds very good.
Comment #7
joaogarin CreditAttribution: joaogarin commentedI am trying the patch but the $css parameter is empty in my alter hook.
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedLooks like an issue with the static cache; this should handle that situation.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedIs this good enough for you or does something else need to be done?
Comment #11
joaogarin CreditAttribution: joaogarin commentedFrom what i see this is already in the 7.x version? I just tested works nicely;) thanks!!
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedGoing to mark this as fixed