4 ms·
I see many articles warning not to deeply nest selectors in sass. Doesn't gzipping your resources mitigate that problem?
by andrethegiant 10y ago
I see many articles warning not to deeply nest selectors in sass. Doesn't gzipping your resources mitigate that problem?
- digestives 10y agoFile size is a moot point with regards to long selectors - they are just a bad idea. [1][2] I am a fan of BEM to keep things sane. [3] [1] http://csswizardry.com/2012/05/keep-your-css-selectors-short/ http://csswizardry.com/2012/05/keep-your-css-selectors-short... [2] https://benfrain.com/css-performance-revisited-selectors-bloat-expensive-styles/ https://benfrain.com/css-performance-revisited-selectors-blo... [3] http://getbem.com/ http://getbem.com/
- dsego 10y agoNesting selectors ties the css to your markup. These styles are not reusable components, but one-offs for that particular snippet of html. Look how bad it can get: https://github.com/edx/edx-platform/blob/master/lms/static/sass/course/courseware/_sidebar.scss https://github.com/edx/edx-platform/blob/master/lms/static/s... It's basically replicating the html nesting.