Help forum

Why spacing variables, aren't visible in viewport width/height?

  • unicodes

    1 year ago

    Should I use a different variable?
    1438067882310373508-Screenshot_2025-11-12_at_09.26.15.png
  • Andreas Møller

    1 year ago

    That is not supported by CSS.

    Designing for specific screen sizes is also generally an anti pattern
    🙏1
  • unicodes

    1 year ago

    Thank you Andreas!
  • unicodes

    1 year ago

    @Andreas Møller , when I used to code, I worked with SCSS, which allowed me to use variables for media queries. Nordcraft relies on vanilla CSS, right?
  • salma

    1 year ago

    yes correct, so annoying you can't use CSS vars in media queries, I've always hated that
    👍1
  • Andreas Møller

    1 year ago

    I actually kinda like that you cant 🙂
  • unicodes

    1 year ago

    Why?
  • Andreas Møller

    1 year ago

    Because people immidiately make a --mobile, --table and --desktop variable.
    https://viewports.fyi/
    🙏1
  • salma

    1 year ago

    Yeah I guess I used to want to create vars for media queries when we needed media queries, before we had responsive units and things like clamp()

    I can't live without clamp()
  • unicodes

    1 year ago

    Like clamp (14px, 10vw, 20px) 🤯 and you solve the issue 😅 .
  • salma

    1 year ago

    yep