



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















--main-color: #ff0000;var(--main-color: #ff0000);custom(--main-color: #ff0000);property(--main-color: #ff0000);--main-color: #ff0000;-- prefix followed by the property name and value.--main-colorvar(--main-color)custom(--main-color)property(--main-color)var(--main-color)var() function.@media (min-width: property(--breakpoint))@media (min-width: var(--breakpoint))var() function.--primary-color with the value #3498db, you would write: __________.--primary-color: #3498db;-- prefix followed by the property name and value.--primary-color in a CSS rule, you would write: color: __________;.color: var(--primary-color);var() function.__________ selector.:root:root selector represents the document's root element and is commonly used to define global custom properties.#000 for a custom property --text- color, you would write: color: var(--text-color, __________);. #000var() function.var() function can be nested within another var() function. var() function can be nested, allowing for complex value compositions.--main-padding: 10px 20px;element.style.setProperty('--main-color', '#ff0000');element.style.setProperty('var(--main-color)', '#ff0000');element.style.setProperty('custom(--main-color)', '#ff0000');element.style.setProperty('property(--main-color)', '#ff0000');element.style.setProperty('--main-color', '#ff0000');setProperty method is used to update custom property values in JavaScript.var() function's fallback value?var() function is optional but recommended for robustness.colorfont-sizemarginRationale: Custom properties in CSS can hold various types of values, including strings, colors, and even other custom properties. Multiple Choice: Which CSS function allows you to access the value of a custom property within another property's value? A) calc() B) var() C) rgb() D) url()
Rationale: The var() function is used to insert the value of a custom property in CSS declarations. Fill-in-the-Blank: Custom properties can be inherited by child elements using the property __.
Rationale: By setting custom properties to inherit, child elements can inherit the value of the custom property from their parent elements. True/False: Custom properties are not supported in all modern browsers.
Rationale: Custom properties are widely supported in modern browsers, making them a reliable tool for front-end developers. Multiple Choice: Which CSS rule is used to update the value of a custom property dynamically? A) @custom B) @property C) @set D) @apply
Rationale: The @apply rule is used to update the value of a custom property dynamically within CSS. Fill-in-the-Blank: Custom properties facilitate the practice of __, allowing for easier maintenance and scalability of code.
Fill-in-the-Blank: Custom properties can improve _ by centralizing style- related values.
Rationale: Centralizing style-related values using custom properties enhances code maintainability and makes it easier to update styles across an entire project. True/False: Custom properties are designed primarily for static styling and cannot be changed dynamically.
Rationale: Custom properties in CSS can be changed dynamically, allowing for responsive and interactive design implementations. Multiple Choice: Which CSS declaration is used to assign a fallback value to a custom property in case it is not defined? A) fallback B) !default C) !important D) unset
Rationale: The unset value can be used to assign a fallback value to a custom property if it is not defined, ensuring graceful degradation. Fill-in-the-Blank: Custom properties are a part of the CSS __ module.
Rationale: Custom properties fall under the CSS Variables module, providing a way to define and reuse variables in CSS stylesheets. True/False: Custom properties must always be declared at the beginning of a stylesheet.
Rationale: Custom properties can be defined anywhere in a stylesheet, making them flexible and versatile for organizing style-related values. Multiple Choice: Which CSS function is used to perform mathematical operations on custom property values? A) add() B) multiply()
Multiple Choice: Which symbol is used to reference a custom property within a CSS declaration? A) @ B) $ C) # D) var()
Rationale: The var() function is used to reference custom properties within CSS declarations by specifying the property name. Fill-in-the-Blank: Custom properties promote _ by allowing developers to define and reuse style values efficiently.
Rationale: Custom properties enhance code reusability in CSS by enabling developers to define values once and reuse them throughout a stylesheet.
Rationale: Custom properties, also known as CSS variables, allow you to define reusable values in CSS.
Rationale: Custom properties in CSS are referenced using the var() function.
Rationale: Custom properties can be dynamically updated using JavaScript, allowing for dynamic changes in styling.
Which of the following is a valid way to update a custom property dynamically using JavaScript? A) document.updateProperty() B) element.style.setProperty() C) setCustomProperty() D) updateCustomValue()
Rationale: The setProperty method allows you to dynamically update custom properties using JavaScript.
Rationale: Custom properties can be inherited by descendant elements within the same document.
Rationale: The :root selector is used to scope custom properties to a specific rule set.
Rationale: Custom properties make CSS easier to maintain and update by centralizing values.
Rationale: The var() function is used to reference custom properties in CSS rules.
Rationale: Custom properties can be defined within media queries to create responsive designs.