vinicius!
KPCKevin Powell - Community
•Created by vinicius! on 11/9/2024 in #front-end
CSS Custom Props Good Practice
First off, I recently found out that local custom properties in CSS can be inherited by child elements, and I’m honestly blown away 🤯.
Second, I have a CodePen with a snippet that illustrates my question. Is it considered best practice to set custom properties on elements and then modify their values with inline styles? Everywhere I look, people advise against inline styles, so now I’m unsure if this case is an exception or if there’s a better approach.
I set
--_hue: 10
local custom props inside .card
element, then i changed the colors of the two others elements with inline-styles
https://codepen.io/bavosadev/pen/vYoQPvy
please ignore all random values, i just wanted to play with calc()
a little4 replies
KPCKevin Powell - Community
•Created by vinicius! on 11/9/2024 in #back-end
REST API and RESTful API are the same thing?
if not, what’s the difference? Are they both idempotent? both send stateless requests? or those are not the differences?
8 replies
KPCKevin Powell - Community
•Created by vinicius! on 10/21/2024 in #front-end
JS Garbage Collector
In js, primitive values don't get garbage collected, right? but if a object is set in the global scope, do they get garbage collected?
27 replies
KPCKevin Powell - Community
•Created by vinicius! on 9/17/2024 in #front-end
Let's discuss the relative unit 'em'
I can't wrap my head around the concept of 'em'. Actually, the hole concept of spacing using units relative to the font-size is difficult for me.
Let's take a default example: responsive padding of a button.
Setting the padding of this button to use 'em' will make it relative to the font-size of the closer parent element, right?
Well, what I don't understand is, what if this parent element is a 'div', or some other elements which we do not set font-sizes?
By default, shouldn't they have the root font-size '16px'? If so, what makes it different from using the unit 'rem'? Or should i set a font-size to these elements as well?
articles, kevin’s videos and others sources to help me understand this concept is more than welcome
31 replies