Hacker News new | ask | show | jobs
by thieu96 1646 days ago
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.

1 comments

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...