3 ms·
Well, my !important story - at the beginning of 2014 I joined a project that was being done for the Danish government, the JavaScript implementation of NemID wh
by bryanrasmussen 5y ago
Well, my !important story - at the beginning of 2014 I joined a project that was being done for the Danish government, the JavaScript implementation of NemID which unless you're in Denmark you probably don't know what it is.
Styling in this project was done with a sass compilation to CSS, and it had hundreds if not thousands of !important declarations inside it. It seems the guy who was there before me had set up the import order of the Sass files incorrectly from more specific to less specific to some really super specific couple things on top of it all (most of the code base was in Java using GWT to compile to JavaScript, so as a consequence most of the programmers were Java guys and did not notice this), basically I cut 800kb of CSS out of the build in the first few weeks by restructuring and getting rid of !important declarations (for anyone who knows NemID you can probably see how this was definitely way too much CSS for what you need to render!)
It was my first time consulting, I sometimes thought, man if I could find the guy who did this (who was I'm told a pretty good designer) I could just follow him around and make money cleaning this stuff up! But alas, I ended up having to work for a living.
- fredsted 5y agoSomeone should do the same with the new MitID implementation! :-)
- bryanrasmussen 5y agoI mean what I see when I use MitID at my bank is basically 2 screens, I can't remember how many screens we had to make for NemID, I think 16 (at the most) and of course they had to be responsive and support Danish, English, and Inuit (Greenlandic) and work the same across a wider number of platforms than most applications. So I doubt it has too many CSS issues in comparison? But haven't looked. on edit: also lots of accessibility requirements of course.