1

CSS and libraries doesn't mix. Something about the lack of scoping and the unintended side effects that happen from using two different libraries that add inline style via JS. I'm looking at you, position!!!!

Comments
  • 0
    And that's why we love utility frameworks
  • 0
    People say CSSModules fixes this, I say that’s a stupid excuse to be lazy.
  • 0
    @petergriffin yeah, css modules only work when EVERY bit of CSS uses it - what about frameworks that set a couple style properties directly on an element???
  • 0
    @natesymer

    A) don’t use that shit
    B) “well fuck you I guess”
  • 0
    @natesymer Those frameworks suck. I like to set css variables or data attributes on the element and refer to them in a class. This way the user can eg. patch a margin by changing how the actual CSS is calculated from the library's values.
  • 0
    @homo-lorens It's the sane thing to do, but there are cases where a library *needs* to position a div absolutely, and that need makes it impossible to, say, have a child of that div be positioned relative to a parent or ancestor of that div. This is common when implementing a modal/tooltip combo inside a overflow: hidden div.
  • 0
    @natesymer Well yeah, but that's a CSS problem, not a library problem. You couldn't do it better even if you had access to the code.
  • 0
    Easy : Stop using javaScript.
  • 0
  • 0
    @natesymer Well, there is a way now to avoid ALL Javascript/TypeScrip.

    I honestlly think that there are only 5 reasons to still use these :

    1. Habit. It exists for decades now. It's well known. even jQuery still works. So it's just easy to start with it and roll. Or application cannot be redisgnied (time, workforce, other commercial reasons)
    2. Beeing concerned about webassembly performances and long time support. These are valid, but unfounded in my opinion only.
    3. Having an axe to grind with any thing Microsoft. This one maybe the stupidest reasons ever. I don't like Linux, I hate doing bash. But the moment I could make a VM with MSSQL on Azure for 200$/month (2x cheaper than windows) I did it. because it was a good thing to do.
    4. Not liking C#. Well, in this case wait for the same technology, using another language. WebAssemb;y is language independent.
    5. Need to support IE. Nothing to add here
  • 0
    @natesymer For me, i'm switching 7 years old knockoutjs app to Blazor (server side) right now. So far, only good things. BTW this knockoutjs app outperform react. BIG time (I'm talking 5 times faster). Blazor brings 50xtimes the speed. Same dataset was used.
  • 0
    @NoToJavaScript Blazor looks frickin SICK. Would be cool if there was a Haskell version. Holy fuck.
Add Comment