Maintainable Interface DesignIntroductionA web interface is maintainable when developers can understand, modify, test, and extend it without introducing unnecessary defects. In a small exercise, a developer may write styles directly inside an HTML file and still achieve an acceptable result. In a real application, however, many pages, components, developers, browsers, devices, and product changes must be supported. Unstructured CSS then becomes difficult to control: one rule unexpectedly overrides another, similar components acquire different appearances, and small changes require editing many files. Maintainable interface design addresses these problems through organization and shared conventions. The principal techniques examined in this chapter are meaningful naming, component thinking, design tokens, separation of concerns, CSS resets, utility classes, and CSS frameworks such as Bootstrap. These techniques are not competing rules that must always be applied identically. They are design choices whose suitability depends on the size, purpose, constraints, and expected lifespan of a project. The central principle is that an interface should communicate its design decisions clearly. A class name should indicate what an element represents or does; a component should have a coherent responsibility; repeated values should be centrally controlled; and the visual system should not be unnecessarily entangled with document structure or application logic. Learning ObjectivesAfter completing this chapter, a learner should be able to: - Explain why maintainability is an important quality of interface code.
- Apply consistent naming conventions to HTML classes and CSS selectors.
- Organize an interface around reusable components.
- Define and use design tokens for common visual decisions.
- Explain separation of concerns in HTML, CSS, and JavaScript.
- Describe the purpose and limitations of CSS resets.
- Compare component, utility, and framework-oriented CSS approaches.
- Use Bootstrap appropriately while retaining control over accessibility and project-specific design.
- Evaluate an interface architecture for consistency, scalability, and accessibility.
1. Maintainability as a Design QualityMaintainability is the ease with which software can be corrected, adapted, and extended. For interface development, it includes at least five related qualities: - Understandability: another developer can determine what a rule or component is intended to do.
- Consistency: similar interface elements behave and appear similarly.
- Changeability: a design change can be made in a small, predictable area.
- Reusability: common solutions can be used in multiple contexts without copying fragile code.
- Testability: appearance, interaction, and responsive behavior can be checked systematically.
A useful distinction is between local knowledge and global knowledge. A developer has local knowledge when the code needed to understand an element is close to that element. A component with a clear class name and a small stylesheet has high local knowledge. A rule that depends on an unrelated ancestor, a later import, and a highly specific selector requires global knowledge and is more difficult to maintain. Maintainability is not the same as minimizing the number of lines of CSS. A very compressed stylesheet may be shorter but harder to understand. Nor is it achieved simply by adopting a framework. A framework can provide structure, but poorly selected classes, overrides, and inaccessible markup can still produce an unmaintainable application. 2. Naming Conventions and Selector OrganizationNames are part of a program's interface. They communicate purpose to humans and provide hooks for CSS, JavaScript, automated tests, and accessibility-related tooling. A useful name describes a role or meaning rather than an accidental visual property. For example, the class notice is generally more durable than red-text. If the visual treatment changes from red to amber, the semantic name remains accurate while the implementation changes. Similarly, primary-action communicates a role more effectively than large-blue-button. 2.1 Semantic and structural namesA semantic name identifies what an element is or what it represents: <article class="product-card">
<h2 class="product-card__title">Keyboard</h2>
<p class="product-card__price">$49</p>
<button class="product-card__action">Add to basket</button>
</article> The names describe the component and its parts. They do not depend on the component being displayed in a particular color, position, or size. A structural name can also be appropriate when it identifies a layout region, such as site-header, main-navigation, or content-grid. Problems arise when structural names expose unnecessary implementation details, for example left-column, because the column may move below the content on a small screen. 2.2 BEM as a practical naming modelBEM—Block, Element, Modifier—is a widely used naming convention. A block is an independent component, an element is a meaningful part of that component, and a modifier represents a variation or state. .card { }
.card__title { }
.card__image { }
.card--featured { }
.card--compact { }The double underscore identifies an element and the double hyphen identifies a modifier. BEM is not a browser requirement; it is a human coordination system. Its advantages include clear ownership and relatively predictable selectors. Its disadvantages include long class names and the temptation to encode too much information in a single name. A modifier should describe a meaningful variation, not an arbitrary page location. .card--featured is useful; .card--homepage-left-column is usually too specific. State classes such as .is-open, .is-disabled, and .has-error are also common. These names indicate a temporary condition and should be applied or removed by JavaScript or server-side rendering as appropriate. 2.3 Classes, IDs, and data attributesClasses are normally the best hooks for reusable styling because multiple elements may share them. IDs should identify unique document targets and are useful for fragment links or accessibility relationships, such as aria-labelledby="dialog-title". Styling every element through IDs creates high specificity and makes reuse difficult. Data attributes are appropriate when markup needs to carry application data or behavior configuration: <button class="menu-button" data-menu-target="account-menu">
Account
</button> A data attribute should not be used merely as an alternative class name. A class communicates styling or component membership; a data attribute communicates data or behavior. 2.4 Avoiding selector fragilityFragile selectors depend heavily on nesting or element order: .page main ul li a span { color: #555; }This rule can stop working when the markup is reorganized. A component-oriented alternative is: .account-menu__link-label { color: var(--color-text-muted); }Low-specificity selectors are usually easier to override. Prefer classes and simple relationships over deeply nested selectors. The child combinator (>) and state classes can be useful, but they should express a real relationship rather than compensate for unclear structure. 3. Component ThinkingA component is a coherent interface unit with a recognizable purpose, structure, visual treatment, and often a defined interaction. Examples include a button, alert, form field, navigation bar, card, modal, or pagination control. Component thinking changes the design question from “How do I style this page?” to “Which reusable interface units make up this page?” A page may contain a header, navigation component, product-card components, a filter form, and a pagination component. Each component can then be developed and tested independently. A well-designed component generally has: - A clear responsibility.
- A predictable HTML structure.
- A documented set of variations.
- Limited assumptions about its parent container.
- Accessible semantics and interaction behavior.
- Styles that do not unintentionally affect unrelated components.
3.1 Component boundariesA component boundary should be neither too broad nor too narrow. A complete product page is often too broad to be a single reusable component, while a separate component for every paragraph may create unnecessary complexity. A useful boundary usually corresponds to a repeated pattern, an independently changing feature, or a meaningful interaction. Components may be composed. A card may contain a button, an image, and a price display. Composition is preferable to duplicating a large block of markup. However, composition should not force every component to know the internal implementation of every child. 3.2 Variants and statesA component often has variants, such as a primary and secondary button, and states, such as hover, focus, disabled, loading, or error. These should be explicit: <button class="button button--primary">Save changes</button>
<button class="button button--secondary">Cancel</button>
<button class="button button--primary" aria-busy="true">Saving…</button> The disabled attribute should be used for genuinely disabled controls, not only a class, because it communicates behavior to browsers and assistive technologies. Focus styles must remain visible. Removing the browser focus indicator without supplying an equally clear replacement is an accessibility defect. 3.3 Component documentationEven a small project benefits from a component inventory. For each component, record its purpose, required markup, variants, states, responsive behavior, and accessibility requirements. A simple inventory may be maintained in a README, style guide, or component-preview page. This reduces accidental variation and helps developers identify whether a new design requires a new component or an existing variant. 4. Design Tokens and Visual ConsistencyA design token is a named value that represents a reusable design decision. Tokens may represent colors, spacing, typography, border radii, shadows, breakpoints, or motion durations. Instead of scattering raw values throughout a stylesheet, developers use names that express intent. :root {
--color-brand: #165dff;
--color-surface: #ffffff;
--color-text: #172033;
--color-text-muted: #5b6475;
--color-border: #d8deea;
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--radius-sm: 0.25rem;
--radius-md: 0.5rem;
}Tokens are commonly implemented as CSS custom properties. A component can then use var(--color-brand) rather than repeating a hexadecimal value. This supports consistency and makes a global theme change more controlled. 4.1 Primitive and semantic tokensA primitive token represents a raw value, such as a blue color or a 1-rem spacing value. A semantic token represents a purpose, such as a link color or a form-control border: :root {
--blue-600: #165dff;
--gray-300: #d8deea;
--color-link: var(--blue-600);
--color-control-border: var(--gray-300);
}Semantic tokens provide an additional layer of meaning. If the design changes, the link color can be updated without searching for every use of the primitive blue value. They also make themes possible: [data-theme="dark"] {
--color-surface: #151a24;
--color-text: #f4f6fb;
--color-border: #3d4658;
}A token system should not become a dictionary of arbitrary values. Too many nearly identical tokens increase cognitive load. Establish a modest scale, document its purpose, and add a new token only when it represents a meaningful design decision. 4.2 Spacing and typography systemsA spacing scale reduces visual inconsistency. For example, a project may use a base unit of 0.25 rem and select a limited set of multiples. This is a convention, not a mathematical law. The scale should support the actual design and should not prevent exceptional values where they are genuinely necessary. Typography tokens can define font families, sizes, line heights, and weights. A readable interface requires attention to line length, contrast, responsive text, and language. Tokens support consistency, but they do not guarantee readability; the resulting design must still be evaluated with real content and assistive technologies. 5. Separation of ConcernsSeparation of concerns means assigning different responsibilities to different layers while allowing them to cooperate. In a typical interface: - HTML provides structure, meaning, and content.
- CSS provides presentation, layout, responsive adaptation, and visual states.
- JavaScript provides behavior, interaction, and dynamic updates.
This separation is conceptual rather than absolute. For example, JavaScript may add a class that CSS uses to display a menu, and HTML attributes may communicate state to both CSS and assistive technology. A good separation might look like this: <button class="accordion__trigger" aria-expanded="false">
Delivery information
</button> .accordion__panel[hidden] {
display: none;
}const trigger = document.querySelector('.accordion__trigger');
const panel = document.querySelector('.accordion__panel');
trigger.addEventListener('click', () => {
const expanded = trigger.getAttribute('aria-expanded') === 'true';
trigger.setAttribute('aria-expanded', String(!expanded));
panel.hidden = expanded;
});The HTML expresses the control and its state, CSS controls presentation, and JavaScript changes the state in response to user input. In production, the code would also need to associate the trigger with its panel, support keyboard behavior where necessary, and handle multiple accordion instances. Separation does not mean that inline styles or scripts are always forbidden. Inline values can be appropriate for genuinely dynamic values, and small educational examples may use them for clarity. The principle is to avoid hiding broad, reusable design logic inside one-off markup or event handlers. 6. CSS Resets and NormalizationBrowsers apply default styles to headings, paragraphs, lists, buttons, forms, and other elements. These defaults differ in some details between browsers and can interact unexpectedly with an application’s design. A CSS reset establishes a deliberate starting point by removing or standardizing selected defaults. A modest reset might include: *,
*::before,
*::after {
box-sizing: border-box;
}
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
img,
svg {
display: block;
max-width: 100%;
}
button,
input,
textarea,
select {
font: inherit;
}The box-sizing: border-box rule makes declared width and height include padding and borders, which often makes layout calculations more predictable. The reset does not eliminate the need for component styles. Developers must still deliberately define margins, typography, focus behavior, and form-control appearance. A reset tends to remove more defaults, while a normalization stylesheet attempts to preserve useful defaults while making browser behavior more consistent. Both approaches involve trade-offs. An aggressive reset may remove helpful accessibility-related styles or create significant work to rebuild sensible defaults. A minimal reset leaves more browser behavior in place but may require developers to understand those defaults. Reset styles should be tested across supported browsers and devices. The project should also define a clear base style for body text, headings, links, lists, and interactive controls rather than assuming that a reset itself constitutes a design system. 7. CSS Organization StrategiesThere is no single universally correct CSS architecture. Three common approaches are component-oriented CSS, utility CSS, and framework-based CSS. 7.1 Component-oriented CSSComponent-oriented CSS places styles near the component they describe: .alert {
padding: var(--space-4);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
}
.alert--warning {
background: #fff8e1;
}This approach is readable and maps naturally to component documentation. Its main risk is duplication when many components need similar layout or spacing rules. 7.2 Utility classesA utility class performs one small, reusable task: .u-hidden { display: none !important; }
.u-text-center { text-align: center; }
.u-mb-4 { margin-bottom: var(--space-4); }Markup may combine utilities: <p class="u-text-center u-mb-4">No results were found.</p> Utilities can make changes fast and reduce the creation of one-off selectors. They also make style decisions visible in the markup. However, excessive utility use can make HTML difficult to read, create long class lists, and encourage developers to design by assembling arbitrary values rather than using coherent components. The !important flag should be used sparingly; a utility system that requires it everywhere may be compensating for a poorly managed cascade. 7.3 Framework-based CSSA CSS framework supplies predesigned conventions, components, utilities, or layout systems. Frameworks can accelerate development and provide responsive patterns. They may also impose visual assumptions, add unused code, complicate customization, and encourage developers to accept markup that does not fully meet a project’s semantic or accessibility requirements. A practical project may combine approaches: a framework for grid and basic utilities, custom component styles for product-specific patterns, and design tokens for branding. The important issue is to define ownership and avoid multiple competing systems for the same decision. 8. Bootstrap: Purpose and Trade-offsBootstrap is a widely used front-end framework containing CSS and, in some versions and distributions, JavaScript components. It provides a responsive grid, utility classes, typography conventions, buttons, forms, navigation patterns, modals, alerts, and other components. A simplified Bootstrap-style layout may look like this: <div class="container">
<div class="row">
<div class="col-12 col-md-8">Main content</div>
<aside class="col-12 col-md-4">Related content</aside>
</div>
</div>The grid classes communicate how columns behave at different viewport widths. Bootstrap’s value is not only visual styling; it is a set of conventions that allows a team to produce common interface patterns quickly. Advantages- Rapid prototyping and implementation.
- Familiar classes that reduce initial design decisions.
- Responsive layout utilities.
- A large user and documentation community.
- Many tested patterns for common interface controls.
- Consistent spacing and component conventions when used systematically.
Trade-offs- A recognizable default appearance may make sites look similar.
- Customization can require understanding variables, build configuration, and cascade order.
- Shipping the entire framework may add unnecessary CSS or JavaScript.
- Framework markup may be less semantically expressive than a project requires.
- Developers may use a component without implementing its required accessible behavior correctly.
- Framework upgrades can introduce breaking changes or require migration work.
Bootstrap components are not automatically accessible simply because the framework provides them. Developers must use correct semantic elements, labels, keyboard behavior, focus management, color contrast, and state communication. For example, a visually styled link should not be used as a substitute for a button when it performs an action. A modal must manage focus, provide an accessible name, and prevent confusing interaction with the background content. The right question is not “Is Bootstrap good or bad?” but “Does Bootstrap fit the project’s constraints?” It may be suitable for an administrative tool, a prototype, or a team that values rapid delivery and established conventions. A highly branded product with a small custom visual language may benefit more from a focused design system. In either case, teams should document which framework facilities are approved and how custom components extend them. 9. A Maintainable Project StructureA small project can organize its styles in layers: styles/
reset.css
tokens.css
base.css
layout.css
components/
button.css
card.css
form-field.css
utilities.cssThis structure is illustrative rather than mandatory. The order expresses a useful dependency direction: - Reset or normalize browser defaults.
- Define tokens.
- Establish base element styles.
- Define page-level layout.
- Define reusable components.
- Add carefully controlled utilities.
The cascade should be intentional. A component should not depend on an accidental import order. Build tools may combine and minimize files, but they do not replace the need for a comprehensible source structure. Teams should also establish conventions for formatting, naming, browser support, accessibility testing, and code review. Automated linting can detect invalid CSS, inconsistent formatting, or some naming violations. Visual regression tests can identify unintended appearance changes, while browser and assistive-technology testing remain necessary for behavior and usability. 10. Applied Case: Refactoring a Student Services PortalThe following is an illustrative case, not a report of a particular organization. BackgroundA student services portal contains announcements, appointment cards, forms, and navigation links. The first version was created rapidly by three developers. Each page contains copied CSS, and buttons are styled through combinations of element selectors, IDs, and page-specific overrides. ProblemA branding update requires changing the primary color, button radius, form spacing, and alert appearance. Developers discover six different blue values, four button implementations, and several selectors such as .dashboard main .content button. Changing one button causes an unrelated dialog to change. Keyboard users also cannot easily see focus on some controls. AnalysisThe portal lacks shared tokens and component ownership. Its selectors have high specificity and depend on page structure. The copied markup has produced visual drift. The team also treated visual similarity as evidence of component equivalence, although the controls have different states and accessibility requirements. Approach and solutionThe team first inventories repeated patterns: button, alert, form field, appointment card, and navigation item. It then creates semantic tokens for brand color, text, surfaces, borders, spacing, and radii. A modest reset establishes box sizing, image behavior, and form font inheritance. The button is redesigned as a component with explicit variants: .button {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 2.75rem;
padding: 0 var(--space-4);
border: 1px solid transparent;
border-radius: var(--radius-md);
font-weight: 700;
cursor: pointer;
}
.button--primary {
color: #fff;
background: var(--color-brand);
}
.button:focus-visible {
outline: 3px solid #f2b705;
outline-offset: 2px;
}The team replaces structural selectors with component classes, removes duplicate rules, and documents required states. JavaScript now changes state classes or accessible attributes rather than writing large sets of inline styles. The team tests at narrow and wide viewport sizes, with keyboard navigation, and with a screen reader. OutcomeThe branding update requires changing a small set of tokens and component rules rather than searching every page. New developers can locate button and alert styles quickly. The portal has fewer accidental overrides, and focus indicators are consistently visible. Some legacy pages still require migration, demonstrating that maintainability is achieved through controlled improvement rather than a single rewrite. Learning points- Repetition is a signal to investigate shared components and tokens.
- Refactoring should preserve behavior while improving ownership and clarity.
- Accessibility states must be designed as part of the component, not added after styling.
- A maintainable architecture lowers the cost of future change but does not remove the need for testing.
11. Limitations, Risks, and Professional PracticeNaming systems can be overused. A long naming convention does not compensate for unclear component boundaries. Design tokens can become rigid if every exceptional value is forbidden, or chaotic if every local value becomes a token. Utility systems can improve consistency but can also move excessive styling decisions into markup. Frameworks can accelerate delivery but can hide important implementation and accessibility decisions. Maintainability also has an organizational dimension. If designers, developers, testers, and content authors use different terminology, the codebase will accumulate translation costs. A shared component inventory and design vocabulary improve communication. Code review should ask whether a new rule belongs to a component, a token, a layout layer, or a one-time exception. Accessibility and governance are essential. Interfaces should support keyboard operation, visible focus, meaningful semantics, sufficient color contrast, understandable errors, and responsive text. Teams should consider privacy when interface scripts collect user data, security when dynamic content is inserted, and licensing when adopting frameworks or third-party components. A framework’s license, version policy, and maintenance status should be checked before it becomes a core dependency. Artificial intelligence tools can assist with class-name suggestions, repetitive refactoring, documentation drafts, and detection of duplicated values. They do not reliably understand product semantics, accessibility requirements, browser support, or the consequences of a cascade change. AI-generated CSS should therefore be reviewed, tested, and integrated into established conventions rather than copied without evaluation. 12. Best-Practice ChecklistBefore completing an interface, ask: - Do class names describe meaning, role, or component ownership rather than accidental appearance?
- Are repeated patterns represented by reusable components?
- Are colors, spacing, typography, and radii controlled through a reasonable token system?
- Is the cascade understandable, with limited specificity and nesting?
- Are HTML, CSS, and JavaScript responsibilities reasonably separated?
- Has the project deliberately chosen a reset or normalization strategy?
- Are utility classes and framework classes used consistently rather than mixed randomly?
- Do interactive components expose focus, disabled, expanded, loading, and error states correctly?
- Has the interface been tested with keyboard input, different viewport sizes, and assistive technology where appropriate?
- Can a new developer locate and safely modify a component without tracing unrelated pages?
Chapter SummaryMaintainable interface design organizes visual and interactive decisions so that they can be understood and changed safely. Semantic naming is more durable than names based on color or position. Component thinking groups structure, styles, variants, states, and accessibility requirements into coherent reusable units. Design tokens centralize shared values and support consistent themes, while semantic tokens express the purpose of those values. Separation of concerns assigns structure and meaning primarily to HTML, presentation to CSS, and behavior to JavaScript, while allowing these layers to communicate through classes and attributes. CSS resets and normalization stylesheets create a deliberate baseline but do not replace thoughtful base styling. Component CSS, utility classes, and frameworks each offer benefits and costs. Bootstrap can accelerate development through established responsive and component conventions, but it requires deliberate customization, accessibility testing, and dependency governance. The most important professional practice is intentionality: every selector, token, component, and framework choice should have a clear purpose. Maintainability is not achieved by one tool; it emerges from coherent conventions, controlled complexity, documentation, testing, and continuous refactoring. Key TermsMaintainability: The ease with which software can be understood, corrected, adapted, and extended. Semantic name: A name that communicates an element’s meaning or role rather than its accidental appearance. Selector: A CSS pattern used to identify the elements to which rules apply. Specificity: The selector-priority mechanism used by CSS to resolve competing declarations. BEM: A naming model based on Blocks, Elements, and Modifiers. Block: An independent component in the BEM naming model. Element: A meaningful part of a BEM block. Modifier: A class indicating a component variation or state. Component: A coherent, reusable interface unit with defined structure and behavior. Design token: A named value representing a reusable design decision. Primitive token: A token representing a raw value such as a color or spacing size. Semantic token: A token representing the purpose of a value, such as link color. CSS custom property: A CSS variable defined with a double-hyphen name and used with var(). Separation of concerns: The organization of different responsibilities into cooperating layers. CSS reset: A stylesheet that removes or standardizes selected browser defaults. Normalization: An approach that makes browser defaults more consistent while retaining useful behavior. Utility class: A small class that performs one narrowly defined styling task. CSS framework: A reusable collection of layout rules, utilities, components, or conventions. Bootstrap: A widely used front-end framework providing responsive layout, utilities, and interface components. Specificity creep: The gradual increase in selector complexity that makes styles difficult to override. Review QuestionsShort Answer Questions- What is meant by maintainability in interface development?
- Why is
product-card generally a more durable class name than blue-box? - What are the three parts of the BEM naming model?
- What is the purpose of a design token?
- State one advantage and one limitation of a CSS reset.
Long Answer Questions- Explain how component thinking can reduce duplication and unintended style interactions in a multi-page application.
- Compare primitive tokens and semantic tokens, and explain why a project may use both.
- Describe how HTML, CSS, and JavaScript can cooperate while maintaining separation of concerns.
- Compare component-oriented CSS, utility classes, and framework-based CSS.
- Explain the advantages and trade-offs of using Bootstrap in a professional project.
Analytical / Application Questions- A project contains selectors such as
.home main .left button and five different declarations for the same brand color. Propose a refactoring plan using naming conventions, tokens, and components. Justify the order of your steps. - Design a maintainable interface architecture for a registration form that includes text fields, validation errors, a loading state, and a success message. Identify the components, tokens, states, and accessibility considerations.
- A team wants to use a CSS framework but has a highly customized visual identity and strict performance requirements. Analyze the decision and recommend conditions under which the framework should be adopted, customized, selectively imported, or rejected.
Multiple Choice Questions with AnswersQuestion 1Which class name is most maintainable for a message whose visual color may change? A. red-text B. warning-message C. left-column-message D. large-orange-box Correct Answer: B. warning-message Question 2In BEM terminology, what does .card--featured normally represent? A. An independent block B. A child element of the card C. A variation of the card block D. A JavaScript data attribute Correct Answer: C. A variation of the card block Question 3What is the primary purpose of a semantic design token such as --color-link? A. To describe the exact HTML nesting of a link B. To express the purpose of a reusable design value C. To replace all component classes D. To disable browser default styles Correct Answer: B. To express the purpose of a reusable design value Question 4Which layer should primarily define document meaning and structure? A. HTML B. CSS C. JavaScript D. A CSS framework Correct Answer: A. HTML Question 5Which practice generally reduces selector fragility? A. Using deeply nested element selectors B. Styling every reusable component through an ID C. Using clear component classes with limited nesting D. Adding !important to every declaration Correct Answer: C. Using clear component classes with limited nesting Question 6What does box-sizing: border-box generally do? A. It removes all element borders B. It includes padding and borders within declared width and height C. It forces every element to have equal width D. It disables responsive layout Correct Answer: B. It includes padding and borders within declared width and height Question 7Which statement about Bootstrap is most accurate? A. Its components are automatically accessible in every implementation B. It provides conventions and components but still requires project-specific testing C. It can only be used for server-side programming D. It eliminates the need for semantic HTML Correct Answer: B. It provides conventions and components but still requires project-specific testing Question 8Which class is most likely a utility class? A. product-card B. checkout-form C. u-text-center D. navigation-item Correct Answer: C. u-text-center Question 9Why should focus indicators generally remain visible? A. They identify the keyboard user's current position B. They increase the number of CSS selectors C. They replace semantic HTML D. They prevent all JavaScript errors Correct Answer: A. They identify the keyboard user's current position Question 10A project needs to change its brand color across many components. Which architecture best supports a controlled change? A. Hard-code a separate color value in every component B. Use a shared semantic color token referenced by components C. Use page-specific IDs for each colored element D. Place all color declarations inside JavaScript event handlers Correct Answer: B. Use a shared semantic color token referenced by components
|