Live data from Hacker News

Inline Scope for CSS

picostitch.com

11–20 of 43 posts

Re: Inline Scope for CSS

#11
post #9

For now, as Firefox support is not yet good, We can use nested rules in CSS. HTML: This is a paragraph CSS: my-custom-element { p { color: blue; } } By choosing a unique name for the custom element, we achieve near the same functionality as @scope.

Svelte does a similar thing: when a component is compiled, it gets a scope class, and its own styles are placed in that scope.

Re: Inline Scope for CSS

#12

> I am not tightly following what's going on in CSS land, since blogs are not the thing and mailing lists became spam lists I don't know where to "listen". Two resources: * https://2023.stateofcss.com/en-US/features/ * https://tailwindcss.com/ Keeping track of TailwindCSS updates is nice, even for non-users: since they "live and breathe" CSS, seeing what they are up to is a good strategy to stay current with CSS deve…

I really wouldn’t say Tailwind does anything that resembles living and breathing CSS.

Their entire value proposition is making shit copy and pastable by ignoring the “C” in CSS and then doing further things to kind of reduce how much you need to know about writing CSS like just making everything a class for example.

I know a lot of people like it but it’s considered a very flawed solution in a lot of ways by people who have a decent working knowledge of CSS to begin with.

Don’t get me wrong I see the appeal of it but the implementation I think leaves a lot to be desired.

Re: Inline Scope for CSS

#14
post #13

Friendly reminder that inline CSS is unsafe and should be avoided. https://stackoverflow.com/questions/41925390

Just to make sure I'm not missing anything: All of that essentially only applies to user/untrusted input, right? i.e. if I have a static website with inline CSS (or JS), there's no security concern.

In that case, I'm not sure I'd consider inline CSS "unsafe." But it's interesting to see how CSS can be exploited in the same way that JS can be.

Re: Inline Scope for CSS

#17
post #12

> I am not tightly following what's going on in CSS land, since blogs are not the thing and mailing lists became spam lists I don't know where to "listen". Two resources: * https://2023.stateofcss.com/en-US/features/ * https://tailwindcss.com/ Keeping track of TailwindCSS updates is nice, even for non-users: since they "live and breathe" CSS, seeing what they are up to is a good strategy to stay current with CSS deve…

I really wouldn’t say Tailwind does anything that resembles living and breathing CSS. Their entire value proposition is making shit copy and pastable by ignoring the “C” in CSS and then doing further things to kind of reduce how much you need to know about writing CSS like just making everything a class for example. I know a lot of people like it but it’s considered a very flawed solution in a lot of ways by people w…

In component-based apps/systems C in CSS is often the last thing you want, if you ever want that.

Re: Inline Scope for CSS

#18
post #9

For now, as Firefox support is not yet good, We can use nested rules in CSS. HTML: This is a paragraph CSS: my-custom-element { p { color: blue; } } By choosing a unique name for the custom element, we achieve near the same functionality as @scope.

Is this not the same as having a class with a unique name, and applying it to a parent div

Re: Inline Scope for CSS

#19
post #12

> I am not tightly following what's going on in CSS land, since blogs are not the thing and mailing lists became spam lists I don't know where to "listen". Two resources: * https://2023.stateofcss.com/en-US/features/ * https://tailwindcss.com/ Keeping track of TailwindCSS updates is nice, even for non-users: since they "live and breathe" CSS, seeing what they are up to is a good strategy to stay current with CSS deve…

I really wouldn’t say Tailwind does anything that resembles living and breathing CSS. Their entire value proposition is making shit copy and pastable by ignoring the “C” in CSS and then doing further things to kind of reduce how much you need to know about writing CSS like just making everything a class for example. I know a lot of people like it but it’s considered a very flawed solution in a lot of ways by people w…

[dead]

Re: Inline Scope for CSS

#20
post #7
post #2

Firefox is planning on it: https://bugzilla.mozilla.org/show_bug.cgi?id=1830512

They're always planning things and always last at things. Even for the most visible and painful cross-browser issues, they always last. One thing being service workers on extensions: available in Chrome since 2020 and we're closing 2024 still without them in Firefox. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...

That's because nowadays the "standards" is "just what chrome does", and the other browsers can only catch up. Witch is easy for edge, opera and the others chrome-clones, but not straightforward for the rest - aka ff.

as other as said this feature was already present in ff only, but then noone picked it up and so it was abandoned

Post reply on HN