49 lines
4.4 KiB
Markdown
49 lines
4.4 KiB
Markdown
---
|
||
id: 23360258-5e55-4f51-ae84-83f073539aef
|
||
title: |
|
||
Using CSS custom properties like this is a waste - YouTube
|
||
status: ARCHIVED
|
||
tags:
|
||
- read-later
|
||
- Youtube
|
||
date_added: 2023-10-14 20:11:15
|
||
url_omnivore: |
|
||
https://omnivore.app/me/using-css-custom-properties-like-this-is-a-waste-you-tube-18b30754bdc
|
||
url_original: |
|
||
https://m.youtube.com/watch?index=12&list=WL&pp=gAQBiAQB&v=_2LwjfYc1x8
|
||
---
|
||
|
||
# Using CSS custom properties like this is a waste - YouTube
|
||
|
||
## Notes
|
||
|
||
Definir _"variables locales"_ en la clase más alta de un _componente_ (Ej: ˋ.cardˋ), esta variable se puede utilizar para hacer variantes del componente de manera más rápida y limpia y se puede utilizar en los decendientes de la clase.
|
||
|
||
Esto tiene la ventaja de:
|
||
1. Para crear una variante de nuestro componente solo debemos crear una nueva clase y añadirla junto a la clase más alta (ˋ.card-successˋ), y ya solo debemos sobre escribir las variables en vez de tener que actualizar cada parte del componente (ˋ.card.card-success .buttonˋ & ˋ.card.card-success .card-header h3ˋ).
|
||
2. Si tenemos propiedades complejas o animaciones donde solo varia una parte de ellas (Ej: ˋdrop-shadowˋ) no tenemos que re-escribir en cada variante la propiedad completa.
|
||
|
||
|
||
---
|
||
## Original
|
||
|
||

|
||
|
||
0:02 / 16:11•Watch full video
|
||
|
||
[](https://m.youtube.com/@KevinPowell)
|
||
|
||
45K views 2 days ago [#css](https://m.youtube.com/hashtag/css)
|
||
|
||
If you're interested in checking out ICodeThis, you can find it here: [https://icodethis.com/?ref=kevin](https://www.youtube.com/redirect?event=video%5Fdescription&redir%5Ftoken=QUFFLUhqbVZsbWpVZ3M1NUdacFdJSVZha3BFQ0ZIaTNoZ3xBQ3Jtc0ttWG5nU0ltOTdzSE9YSDQ3aWlsUVFGcEVoMlRFaVhLb0hrczRKRVgta3N0bXBIeC1Sc1ZtTWJHY2MycUpfdVN6OE5pWDlfTG9WQlhTMlRzcW1YX2p1MTY4bjVybTd1ZG02RV9zM1l0QkFWeTNybjBtcw&q=https%3A%2F%2Ficodethis.com%2F%3Fref%3Dkevin&v=%5F2LwjfYc1x8) and if you want to sign up for one of their premium plans, use KEVIN at checkout for an extra 10% off. Custom properties are amazing, but a lot of people don’t take advantage of how awesome they are. They set them up in the :root and that’s it, but they can be so much more useful than that! So, in this …
|
||
|
||
...more
|
||
|
||
...more
|
||
|
||
45,645 views • Oct 12, 2023 • #css
|
||
|
||
#### License
|
||
|
||
Shop the Kevin Powell store
|
||
|