Decisions about front-end

Architectural decision records tagged with front-end

18 decisions
  1. accepted
    Enforce SDC Schema Validation

    Without enforced schema validation, Single Directory Components can silently accept incorrect or missing props, leading to runtime errors and inconsistent rendering.

    front-end sdc
  2. accepted
    Load JavaScript libraries conditionally

    Loading all JavaScript globally increases initial page weight and slows down pages that don't need it.

    front-end javascript
  3. accepted
    Use data-drupal-selector to target form elements in JavaScript

    Classes and IDs are unstable JavaScript targets in Drupal, while data-drupal-selector is a stable hook provided by the Form API.

    drupal front-end javascript
  4. accepted
    Respect prefers-reduced-motion for all animations and transitions

    Users with vestibular disorders rely on the prefers-reduced-motion media query to disable or reduce motion that can cause discomfort.

    front-end css javascript accessibility
  5. accepted
    Use Stylelint

    Using Stylelint helps prevent errors and keeps code in a consistent format.

    front-end css
  6. accepted
    Self-host Third-Party Static Assets

    Third-party hosted assets (e.g. web fonts, icon libraries) can lead to performance, privacy, and reliability issues. These include GDPR violations, extra DNS lookups, and outages outside the organization control.

    front-end performance javascript css
  7. accepted
    Layer elements deliberately with stacking contexts

    Overlap elements predictably by creating new stacking contexts for z-index values.

    front-end css
  8. accepted
    Use SVG view box instead of width and height

    Using viewBox improves maintainability.

    front-end performance
  9. accepted
    Enforce Twig coding standards with automatic linting

    Linters like twigcs keep code more consistent and readable

    twig drupal front-end
  10. accepted
    Avoid using jQuery

    jQuery is an unnecessary dependency for modern browsers.

    front-end javascript
  11. accepted
    Use relative units in CSS for resizable content

    Using relative units improves accessibility by ensuring that text and content does not overlap when zooming web pages or changing the base font size.

    front-end css
  12. accepted
    Use SVGs for icons

    Using SVGs for icons has the best display, performance, and accessibility

    front-end accessibility performance
  13. accepted
    Load JavaScript as external resource with defer attribute

    Loading JavaScript as deferred has the best default performance

    javascript front-end performance
  14. deprecated
    Load JavaScript as external resource with async and defer attributes

    Loading JavaScript as async & deferred has the best default performance

    javascript front-end performance
  15. accepted
    Use JavaScript strict mode

    Opt in to settings that raise errors for problematic code.

    front-end javascript
  16. accepted
    Use SMACSS to organize CSS within projects

    Organizing CSS within projects the same way Drupal organizes its CSS establishes a consistent pattern.

    front-end css
  17. accepted
    Use TypeScript for pure JavaScript development

    Strictly typed languages like TypeScript avoid unexpected behavior, prevent bugs, and improve code maintainability.

    javascript front-end back-end developer-experience
  18. accepted
    Use CSS Logical Properties

    Decoupling styles from a language's writing direction makes them easier to maintain across translations.

    front-end css multilingual

Search Decisions