I use the DigitalOcean community tutorials a lot for examples how to setup up different things in Linux (Nginx, MySQL, firewall, ...) and would al...
For further actions, you may consider blocking this person and/or reporting abuse
This is neat! I didn't realize you could pass things directly from HTML attributes to CSS using the
attr()
function. That seems like a really semantic way of handling cases like this.Thanks!
It always makes me happy to be able to learn new things to other people😄
I came here to say the same thing! I didn't know that you could pass data around like that. This is awesome!
I have to admit I usually run away when CSS is being discussed,
but I thought I know most of it.
Well,
content: attr(prefix);
blew my mind.Lol I am in the same boat as you on this 😂I am a "CSS newbie".
I also still learn a lot from CSS and it amazes me how much it changed compared to a few years ago. In "the old days" you where forced to use JS for a lot of animations but now you can do almost everything with only CSS.
Would it also be possible to say if you don't pass on a prefix in the html it shows default ($) and otherwise use the prefix? Seems a bonus on top the bonus to me!
Good question! I did a quick search and actually you can. developer.mozilla.org/en-US/docs/W...
attr()
has an optional fallback, however this is still an experimental feature.And here i am looking at the docs and missing the last part about the fallback.. Thanks for that! Doesn't seem to work in my version of chrome yet tho.
Nice write up Glenn - For me this brought up a follow-up Q for you that might make for another good post...
If it was possible, do you think people would prefer that single-line terminal commands copied from webpages don’t include the linebreak?
(IE. would it be better that the command doesn't run immediately when posted into your terminal)
If so, how would you do it?
Interesting question, this might be a good #discuss topic.
I personally like to copy/paste without a linebreak, so I can always double check the command or edit/add things.
Your question "how would you do it?", do you mean as a dev that made the code block or as a user that copy/pasted the command?
Seems to work well on mobile too, nice find!