News for hackers. Stuff that matters.
Re:Pico CSS Framework by thieu96 on Wednesday December 15, 2021 @06:34AM (#29564549)
On the surface this looks nice, until you start using 3rd party componentsand the defaults they assumed for the component are overwritten because the default is changed.

It's no coincidence that we use classes to explicitly apply styles, I don't think this library is a good idea.

It's the same issues as changing native prototypes in Javascript, stuff depends on the defaults to be exactly as specified.

Explicit > Implicit Stuff magically working is great until you need to make an exception.

Re:Pico CSS Framework by h3mb3 on Wednesday December 15, 2021 @07:28AM (#29565060)
You could namespace the Pico styles using SASS. Basically like [1] but you'd extend it to be e.g.

  .pico-enabled *:not(.piko-disabled) {
    @import "layout/document"
    @import "layout/sectioning"
    @import "layout/container"
    ...
Then you can do this:

  <div class="piko-enabled">
    ...
    <button>A button with Piko styling</button>
    <div class="piko-disabled">
      <button>A vanilla browser button</button>
      ... and any 3rd party components/elements etc ...
[1] https://github.com/picocss/pico/issues/31#issuecomment-91399...