CSS Inheritance
Herencia en CSS
La herencia de CSS permite que algunas propiedades copien un valor de un elemento padre. Esto ocurre cuando el hijo no tiene un valor propio.
Otro ejemplo
Un artículo establece `color` y `font-family` una vez en su raíz. Las citas y palabras dentro luego heredan esos estilos. Un widget de compra puede restablecer los estilos de texto heredados con tokens con alcance. `border` y `padding` no se heredan, por lo que el widget los establece directamente.
Partes principales
- 01Valor calculado principal
- 02Propiedad heredada
- 03Valor usado por el hijo
Úsalo cuando
Usa herencia para estilos de texto, color y propiedades personalizadas que deben mantenerse consistentes en una sección.
No lo uses cuando
No todas las propiedades se heredan. Usa `inherit`, `initial`, `unset`, `revert` o `revert-layer` solo cuando esa palabra coincida con el resultado que deseas.
Nombre usado en código
inherit, initial, unset, revert, revert-layer, and inherited custom properties Antes de lanzarlo
Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience.
Outcome: Complete the task with Herencia en CSS (CSS Inheritance). User context: Un artículo establece `color` y `font-family` una vez en su raíz. Las citas y palabras dentro luego heredan esos estilos. Un widget de compra puede restablecer los estilos de texto heredados con tokens con alcance. `border` y `padding` no se heredan, por lo que el widget los establece directamente. Design concept to apply: Herencia en CSS (CSS Inheritance). Why it fits: Usa herencia para estilos de texto, color y propiedades personalizadas que deben mantenerse consistentes en una sección. Do not use it when: No todas las propiedades se heredan. Usa `inherit`, `initial`, `unset`, `revert` o `revert-layer` solo cuando esa palabra coincida con el resultado que deseas. Design requirements: Set the content order, shared design values, and reusable components. Define how the layout changes by screen size and state. Keep useful design choices separate from decoration. Inclusion and resilience: Check contrast, zoom, languages, themes, and reduced motion when needed. Do not use color or effects as the only way to show meaning. Acceptance criteria: The design stays clear on phones and desktops, at zoom, in every theme, and in all supported languages. Interactive states stay clear and consistent. Evidence and limits (evidence boundary): Un documento formal aún puede ser un borrador, un release candidate o una versión final. Revisa su estado y la compatibilidad con tu navegador o plataforma. Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.
Revisa esta petición
Review how Herencia en CSS (CSS Inheritance) is used now. Definition: La herencia de CSS permite que algunas propiedades copien un valor de un elemento padre. Esto ocurre cuando el hijo no tiene un valor propio. Release checks: Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.