r/css • • 22h ago

Question How to choose color palette

5 Upvotes

I have just come across the light-dark() function and experimented with it. Now I realise color choice became limited, especially pairing light-dark part.

Does using light-dark scheme limit colour choice? I would love to know if there is any better scheme generator tool out there to experiment. I currently use colorffy.


r/css • • 13h ago

No AI used Using animation-timeline: scroll() for stickiness while scrolling inside SVGs

1 Upvotes

I had occasion to utilise an .svg file as a comic strip viewer, with the panels being a vertical strip to scroll through, and I wanted buttons for: a) restarting the UI-less slideshow, and b) going to a grid overview of all the panels.

I originally just made nine copies of the same two buttons, positioning each at the "same" point at the bottom of each panel, but then I saw that animation-timeline: scroll() recently landed in all browsers so decided to give that a go.

No critiques of the comic itself please, it's not mine:

https://imglink.cc/cdn/RLSQglSGwy.svg#p1

SVG <defs>:

<text id="rst">↻</text><text id="idx">📇</text>

SVG Content:

<g id="hud">
  <a href="#slide" aria-label="Restart SLIDESHOW"><use href="#rst" x="5" y="680"/></a>
  <a href="#Nav" aria-label="Go to OVERVIEW"><use href="#idx" x="326.5" y="677"/></a>
</g>

CSS:

@supports (animation-timeline: scroll()){
  :root:has(image:target) #hud,:root:has(rect:target) #hud{
    animation:hud-pin 1s linear both;animation-timeline:scroll(root block)
  }
  @keyframes hud-pin{0%{transform:translateY(0px)}100%{transform:translateY(5504px)}}
}

r/css • • 23h ago

Question I've been learning SCSS for about 3 days. I'm trying to integrate a mixin from a partial I dedicated to media-query responsiveness. My media query styles aren't applying. I have a feeling it's because of how I'm calling the mixin. Could anyone see what's wrong with my code?

Thumbnail reddit.com
1 Upvotes

r/css • • 1h ago

Question IHTMl en Reddit!!!

Thumbnail reddit.com
0 Upvotes