31
Bagul
8y

Is... is this normal? 20k+ lines of CSS seems like overdoing it a little.

Comments
  • 0
    Well, I had a couple of CSS files that were around 16000 lines. Imported all the CSS for Material Design just to style a few buttons 😁
    Yes, bad practice I know.
  • 1
    Breaking CSS up into multiple, highly-organized lines like this is the only way I can make sense of things like Bootstrap.
  • 3
    Looks like the comments make up 40% of the file, css is pretty self explanatory
  • 3
    20,000 lines of anything in a single file is bad practice, for CSS it should be split into multiple files and linked in the head section of the document (you can use CSSs import feature as well but this stops concurrent loading of stylesheets which isn't wise), or you can use a preprocessor like LESS or SAAS to manage everything nicely. Generally the more modern way is to use a preprocessor, have everything logically split into files for development, but when deploying to production concat everything into a single file (depending on a few other things)
  • 2
    Bruh, use sass. There's no possible way to manage all that code. Version control nightmare
  • 0
    That's why you use Sass to avoid an overspill like this
  • 0
    Are you sure it's not a lot of files concatenated? Because that would be kind of normal.
  • 0
    alternative to Sass would be to setup postcss, which you can choose what features you'd like to include.
Add Comment