CSS Quality & Compliance Flashcards
7 cards from real CSS practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 CSS Quality & Compliance flashcards as text
Which tool is most commonly used to lint and enforce code quality rules in CSS?
Answer: Stylelint
Stylelint is the standard linter built specifically to catch errors and enforce conventions in CSS.
What does the WCAG minimum contrast ratio of 4.5:1 apply to?
Answer: Normal-size text against its background
WCAG AA requires a 4.5:1 contrast ratio for normal text to ensure readability.
Which practice improves CSS maintainability across a large codebase?
Answer: Using a consistent naming convention like BEM
A convention like BEM makes class names predictable and reduces conflicts in large projects.
Why is overusing the !important declaration considered poor quality?
Answer: It breaks the natural cascade and is hard to override
!important overrides the cascade, making styles fragile and difficult to maintain.
Which CSS feature helps reduce repetition and improve consistency of values?
Answer: Custom properties (CSS variables)
Custom properties let you define a value once and reuse it, ensuring consistency.
What is a key accessibility concern when removing the default focus outline?
Answer: Keyboard users lose a visible indicator of focus
Removing focus outlines without a replacement leaves keyboard users unable to see where they are.
Which of these is a sign of low-quality, hard-to-maintain CSS?
Answer: Deeply nested, overly specific selectors
Highly specific nested selectors are brittle and difficult to override or reuse.