Fit height to background pattern size with calc-size(). @shadeed9 has a section ...
Web Standards @webstandards_dev@mastodon.social
Fit height to background pattern size with calc-size(). @shadeed9 has a section where a pattern tiled on both axes gets cut off at the bottom. Using background-repeat: round helps but stretches or shrinks the tiles. Instead, height: calc-size(auto, round(up, size, var(--tile-height))) rounds the content height up to a multiple of the tile height. The same round() keeps padding-block in step with the pattern. Chrome-only for now. #css #layout
https://ishadeed.com/article/fit-height-background-pattern-calc-size/