Lobotomized owl CSS selector broken
See original GitHub issueI like to use a pattern of a CSS flex-box with whildren evenly spaced using the lobotomized owl selector.
My CSS looks like this:
.user-section {
display: flex;
}
.user-section > * + * {
margin-left: 4px;
}
Svelte compiles it into this:
.user-section.svelte-1aasoha {
display: flex
}
.user-section>*+.svelte-1aasoha {
margin-left: 4px
}
The right eye of the owl is replaced with the unique Svelte-generated selector id for the flexbox. I expected the unique id to be appended to the flexbox selector before the >
part of the selector.
Is the id just naively appended to the end of the selector? Maybe a whitespace collapse is set to happen too early when handling this selector.
Svelte version: 3.5.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Axiomatic CSS and Lobotomized Owls - A List Apart
Called the “lobotomized owl selector” for its resemblance to an owl's vacant stare, it proved to be the most popular section of my...
Read more >Axiomatic CSS and the Lobotomized Owl Selector (* + *)
One thing I have noticed, is that the owl selector matches <body> element, because body is actually a sibling to the <head> element....
Read more >Get to Know The Lobotomized Owl Selector - Pine
The lobotomized owl selector is an exciting CSS concept which helps you make a decent content flow in your design with just a...
Read more >An ode to the CSS owl selector - DEV Community
"Solving solutions in CSS can be easy or elegant." The lobotomized owl selector. Heydon explains the selector better in his article than I...
Read more >Lobotomized Owls - CSS-Tricks
But I didn't come to any stunning conclusion in that article. The best I came up with was a kinda gross compound selector...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
~
/+
should now be getting scoped properly in v3.27.0.I was just thinking about this more, and there seem to be a lot more things to worry about with sibling selectors than with the other ones. For example:
then
.b + .a
is a valid selector, because the loop will wrap around. In general, there seems to be a large number of cases to cover when deciding whether two elements can be (adjacent or non-adjacent) siblings when{#if}
s/{#each}
s/{:else}
s/{#await}
s become involved.