https://htmx.org logo
Join Discord
Powered by
# missing_dot_css
  • g

    gorgeous-airport-54386

    02/21/2022, 9:48 PM
    i just wanted to show how effective cssnano + compression is
  • m

    mysterious-toddler-20573

    02/21/2022, 9:49 PM
    it will be a great day when we can hook this in to https://demo.htmx.org
  • g

    gorgeous-airport-54386

    02/21/2022, 9:49 PM
    wrt. components, we decided to provide all three ways (class, attribute, tag) but one problem is selector explosion. if we select a heading inside a card, that makes 18 selectors
  • m

    mysterious-toddler-20573

    02/21/2022, 9:50 PM
    🤔
  • m

    mysterious-toddler-20573

    02/21/2022, 9:50 PM
    example?
  • g

    gorgeous-airport-54386

    02/21/2022, 9:50 PM
    Copy code
    css
    .missing-card, missing-card, [missing-card] {
        & :--heading {
            color: red;
        }
  • g

    gorgeous-airport-54386

    02/21/2022, 9:50 PM
    becomes
  • g

    gorgeous-airport-54386

    02/21/2022, 9:51 PM
    Copy code
    css
    .missing-card h1,missing-card h1,[missing-card] h1,.missing-card h2,missing-card h2,[missing-card] h2,.missing-card h3,missing-card h3,[missing-card] h3,.missing-card h4,missing-card h4,[missing-card] h4,.missing-card h5,missing-card h5,[missing-card] h5,.missing-card h6,missing-card h6,[missing-card] h6 {
            color: red;
        }
  • m

    mysterious-toddler-20573

    02/21/2022, 9:52 PM
    tbh, I'm fine w/ that
  • m

    mysterious-toddler-20573

    02/21/2022, 9:52 PM
    computers are really fast
  • m

    mysterious-toddler-20573

    02/21/2022, 9:52 PM
    and it's all cached after the first download
  • m

    mysterious-toddler-20573

    02/21/2022, 9:53 PM
    if the aksimsek gambit can work in hyperscript, we can have a few selectors in missing.css
  • m

    mysterious-toddler-20573

    02/21/2022, 9:57 PM
    I think if you keep it around 10k, that's great, but it could be as big as bootstrap
  • m

    mysterious-toddler-20573

    02/21/2022, 9:58 PM
    I'm more concerned about not needing to hack up HTML than file size
  • g

    gorgeous-airport-54386

    02/21/2022, 9:58 PM
    is that bootstrap compressed
  • m

    mysterious-toddler-20573

    02/21/2022, 9:58 PM
    yes
  • g

    gorgeous-airport-54386

    02/21/2022, 9:58 PM
    ok just checking
  • m

    mysterious-toddler-20573

    02/21/2022, 9:58 PM
    https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css
  • m

    mysterious-toddler-20573

    02/21/2022, 10:00 PM
    161k uncompressed
  • g

    gorgeous-ghost-95789

    02/21/2022, 10:30 PM
    ooof!
  • g

    gorgeous-ghost-95789

    02/21/2022, 10:31 PM
    I'd say build first, optimize later. Once you have a working prototype, check to see if the explosion looks like it's gotten out of hand. My guess is that limiting the number of selectors won't affect the compressed download size that much. If it does, then we can always choose the best one (or two) methods for selectors.
  • g

    gorgeous-ghost-95789

    02/21/2022, 10:32 PM
    But until selector explosion gets out of hand and is either 1) hard to manage while developing, or 2) measurably affects the size/speed of the library -- I'd say don't worry about it. No need to prematurely optimize.
  • a

    adamant-exabyte-92636

    02/22/2022, 6:25 PM
    Agree. But easy for me to say, I'm not the one that has to keep 37 selectors straight 😅
  • g

    gorgeous-airport-54386

    02/22/2022, 8:26 PM
    https://github.com/bigskysoftware/missing/blob/master/Contributing.md
  • m

    mysterious-toddler-20573

    02/22/2022, 8:42 PM
    looking very clean!
  • m

    mysterious-toddler-20573

    02/22/2022, 8:42 PM
    One thing I really appreciate is how you constantly refer to the HTML spec, so I think we should think about doing is linking to the spec to justify particular decisions (hacker news enters the chat)
  • g

    gorgeous-airport-54386

    02/22/2022, 8:43 PM
    I have a spec link at the start of each file in
    src/elements/
  • g

    gorgeous-airport-54386

    02/22/2022, 8:43 PM
    Copy code
    /***
     4.4 Grouping content
     https://html.spec.whatwg.org/multipage/grouping-content.html
     ***/
  • m

    mysterious-toddler-20573

    02/22/2022, 9:17 PM
    absolute 👑
  • g

    gorgeous-airport-54386

    02/23/2022, 6:53 PM
    it still needs a lot of work but it works pretty nicely i think
1...121314...44Latest