You are tasked with creating a theme switcher that changes a set of color variables. How can SASS/SCSS functions assist in achieving this?

  • Create SASS/SCSS functions that return different color values based on the selected theme.
  • Define multiple sets of color variables and switch between them using conditional statements.
  • Manually update the color variables in the SCSS files when a theme change is required.
  • Use JavaScript to change the color variables dynamically in the HTML.
To create a theme switcher in SASS/SCSS, you can define different color variables and use SASS/SCSS functions to return the appropriate color values based on the selected theme. This allows you to switch themes easily by changing a single variable and ensures consistency across your project.

What is the default value of the animation-direction property in CSS?

  • alternate
  • forwards
  • normal
  • reverse
The default value of the animation-direction property in CSS is normal. When animation-direction is set to normal, the animation plays forward, and then it starts from the beginning when it reaches the end, creating a continuous loop.

Which CSS property is used to clear the effects of floating elements?

  • border
  • clear
  • margin
  • padding
The clear property in CSS is used to clear the effects of floating elements. It ensures that no element should touch the left or right-hand sides of a floating element and that it should appear below any preceding floating elements.

What is the correct syntax to use a custom property in your CSS?

  • #property-name
  • &property-name
  • *property-name
  • --property-name
To use a custom property (also known as a CSS variable), you should use the syntax --property-name. Custom properties allow you to define reusable values in your CSS and use them throughout your stylesheet. They are preceded by two hyphens and are referenced with the var() function, like var(--property-name).

In Styled Components, styles are written inside the ________.

  • CSS files
  • HTML files
  • JSX files
  • JavaScript files
In Styled Components, a popular library for styling React components, styles are written inside JavaScript code using tagged template literals (usually within JSX files). This approach allows developers to encapsulate styles within the components themselves.

You're trying to vertically center a single item inside a container using Flexbox. Which properties would you set on the container to achieve this?

  • align-items: center and flex-direction: center
  • align-items: center and justify-content: center
  • flex-direction: center and flex-wrap: center
  • justify-content: center and align-content: center
To vertically center a single item inside a container using Flexbox, you would set the align-items property to "center" to vertically align the item within the container, and you would set justify-content to "center" to horizontally center the item within the container.

You're creating a button hover effect where the button scales up gradually. Which combination of CSS properties would you primarily use?

  • transform: scale(1.2);
    transition: transform 0.3s ease-in-out;
  • transition: scale(1.2) 0.3s ease-in-out;
    transform: scale(1.2);
  • scale(1.2);
    transition: transform 0.3s ease-in-out;
  • transform: scale(1.2);
    animation: scaleUp 0.3s ease-in-out;
To create a button hover effect where the button scales up gradually, you would primarily use the combination of CSS properties: transform: scale(1.2); for scaling the button and transition: transform 0.3s ease-in-out; to specify the transition duration, easing function, and the property to be transitioned (in this case, "transform"). This combination smoothly scales up the button on hover.

If you want an animation to play forwards first, then reverse on alternate cycles, which value of animation-direction would you use?

  • alternate
  • alternate-reverse
  • normal
  • reverse
To make an animation play forwards first and then reverse on alternate cycles, you would use the animation-direction property with the value alternate-reverse. This value causes the animation to run normally on odd iterations (forwards) and in reverse on even iterations.

The ::first-letter pseudo-element in CSS targets the ________ of a block-level element.

  • First character
  • First letter
  • First line
  • First word
The ::first-letter pseudo-element in CSS is used to target the first letter of a block-level element, such as a paragraph or a heading. It's commonly used for styling the initial letter of a text block, for decorative or typographic purposes.

Which of the following is NOT a unit for font-size in CSS?

  • cm
  • em
  • ex
  • px
In CSS, font-size can be specified in various units, including em, ex, px, and cm. However, 'cm' is not a common unit for font-size. It's typically used for specifying dimensions of other elements, like margins or padding.