#cssWTF

Ana Tudor 🐯anatudor
2024-09-18

The scrollbar is a part of which box?

codepen.io/thebabydino/pen/LYK

You would think

`background: teal content-box`
and
`background: linear-gradient(teal 0 0) content-box`
produce the same result. Except...

`background: teal content-box` doesn't stretch under transparent scrollbar track

`background: linear-gradient(teal 0 0) content-box` stretches under transparent scrollbar track

Screenshot of the first case.Screenshot of the second case.
Ana Tudor 🐯anatudor
2024-05-11

Extremely annoying gotcha: container query units seem to be relative to the `content-box` dimensions. And there doesn't seem to be any way to make them relative to the `border-box` dimensions... which is what I need to solve other problems caused by container queries. 😭

Ana Tudor 🐯anatudor
2024-04-16

(or )

If you use a vertical `writing-mode` and you also have a pseudo with some `content`, that `content`... may or may not be rotated, depending on its nature! 😼

I'm not even kidding. And it's the same in every browser.

test codepen.io/thebabydino/pen/VwN

The relevant CSS:

```
body { writing-mode: vertical-lr }

div {
	font: 1.5em sans-serif;
	
	&::before {
		color: crimson;
		content: attr(data-c)
	}
}
```

And the visual result: the checkmark and the cat face emoji don't get rotated like the rest of the element text, but the letter 'A' does.
Ana Tudor 🐯anatudor
2024-04-11

In

😵`grey` is darker than `darkgrey`
😵`pink` is lighter than `lightpink`
😵‍💫R channel at 255 with G & B at 0 is `red`, B channel at 255 with R &G at 0 is `blue`... but G channel at 255 with R &B at 0 is not `green`, it's `lime`!
🥴`fuchsia` is `magenta`
🥴`aqua` is `cyan`

For real, see this page by @Meyerweb meyerweb.com/eric/css/colors/ (which I've been using for over a decade)

A bit of history twitter.com/briankardell/statu

Grumpy-looking beautiful fluffy cat sitting on a keyboard.
Ana Tudor 🐯anatudor
2023-09-12

Unexpected errors on .

I ended up replacing Autoprefixer.

CodePen CSS error: Replace transition-property to transition, because Autoprefixer could not support any cases of transition-property and other transition-*
Ana Tudor 🐯anatudor
2023-09-05

The !important things in life...

(cannot for the life of me understand why some are 9999px and some are 99999px)

¯\_(ツ)_/¯

DevTools screenshot of a lot of style elements, each with just a character vomit class setting the width to either auto, 9999px or 99999px  and making it !important too!
Ana Tudor 🐯anatudor
2023-09-03

TIL twitter.com/SelenIT2/status/16

The spec, though I don't understand what's written in there drafts.csswg.org/css-images-3/

Meaning I can only get fixed constant thickness elliptic arcs only with two radial gradients, the second one being a cover for the inside of the ellipse.

codepen.io/thebabydino/pen/bGO

Screenshot comparing the results in the two cases in the CodePen demo.
Ana Tudor 🐯anatudor
2023-08-13

Are you okay, Chrome DevTools?

280x360 element. The padding is 24px in the normal state and 0px in the hovered state.

I force the hovered state from DevTools. The result on the page looks fine, the computed value shows up as 0px. It's just the box model illustration that's WTF.

Screenshot of the Computed tab in Chrome DevTools. The computed padding values are fine, but the values on the box model diagram aren't.
Ana Tudor 🐯anatudor
2023-02-15

Making test cases for filing bugs at 4:30am because why not... 😭

Ana Tudor 🐯anatudor
2023-01-23

Web dev in real life.

This is not how I'm used `justify-content: space-between` works. There are no other properties other than `padding: 6px` set on the flex container or children.
Flex container is a `div` and the children are a `ul` and a `p`.

If I set `flex-grow: 1` just on the 1st child, I'm still left with a space on the right of the second one.

The two gaps aren't even equal, the second one is bigger than the first.

Losing it.

In spite of having set justify-content: space-between on the flex container, the second of its two children doesn't stick to its right edge.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst