Acquia FE Specialist (D10) cheat sheet
Acquia FE Specialist (D10) · Keep the key ideas within reach.
Fundamental Web Development Concepts
HTTP is stateless: each request/response pair is independent unless state is carried by cookies, sessions, or tokens.
Status code classes: 2xx success, 3xx redirection, 4xx client error, 5xx server error; 304 means the cached copy is still valid.
Cache-Control directives: no-store forbids caching, no-cache requires revalidation, max-age sets freshness lifetime in seconds, immutable skips revalidation.
GET is safe and idempotent; POST is neither; PUT and DELETE are idempotent but not safe.
DOM is a tree of nodes; CSSOM is built from stylesheets; render tree = visible DOM nodes combined with computed styles.
Critical rendering path order: HTML parse, CSS fetch/parse, render-blocking stop, layout, paint, composite.
Same-origin policy compares scheme, host, and port; CORS response headers (Access-Control-Allow-Origin) relax it for cross-origin fetches.
Progressive enhancement layers semantic HTML first, then CSS, then JavaScript, so core content works without scripting.
Drupal Theming Fundamentals
Theme discovery scans /themes and /themes/custom; a theme requires an .info.yml file whose name matches the directory name.
Base theme is declared with the base theme key in .info.yml; a theme without it is a base theme itself.
Template suggestion order runs from most specific to most general; the first suggestion found in the registry wins.
Preprocess functions run in order: modules first, then the base theme, then the active subtheme, so the subtheme can override earlier values.
Twig debug (twig.config debug: true in services.yml) enables the HTML comment listing theme hook and candidate template names.
Libraries are declared in libraries.yml and attached via {{ attach_library() }}, a #attached render array property, or the theme's info.yml libraries key.
Regions are declared under the regions key in .info.yml; page.html.twig prints them with {{ page.regionname }}.
Classy was the Drupal 8 base theme; from Drupal 10 its templates were merged into Stable 9, which is the default base theme.
Twig Templating
{{ }} outputs an expression; {% %} executes a tag; {# #} is a comment that produces no output.
Autoescaping is on by default for HTML contexts; use |raw only for trusted markup and |t for translatable strings.
Filters transform values (|upper, |length, |date, |without, |clean_class); functions return values (attach_library(), url(), path(), dump()).
Attribute objects are printed directly (e.g. {{ attributes }}) so core-added classes and data attributes are preserved.
Whitespace control uses {%- and -%} to trim adjacent whitespace in rendered output.
Twig templates map to theme hooks: node.html.twig for nodes, field.html.twig for fields, block.html.twig for blocks.
The loop variable inside {% for %} exposes index, index0, first, last, and length.
{{ dump() }} requires Twig debug mode; it is a development aid and must not ship to production.
Theme Development Best Practices
Override templates in the subtheme rather than editing contrib or core; subtheme paths take precedence in the suggestion chain.
Use single directory components or a components directory with co-located Twig, CSS, and JS to keep markup and styles together.
Namespace CSS classes with a component prefix (BEM-style block__element--modifier) to avoid collisions across templates.
Never hardcode paths or text: use {{ url() }} / {{ path() }} for links and |t or |trans for user-facing strings.
Escape output by default; reserve |raw for markup generated or sanitized by trusted code.
Declare JS and CSS dependencies in libraries.yml with dependencies keys so load order is deterministic.
Keep logic in preprocess functions and plugins; Twig should hold presentation decisions only.
Use stable cache metadata (cache tags, contexts, max-age) on render arrays so theming changes do not break caching.
Front End Performance and Accessibility
Core Web Vitals thresholds: LCP good <= 2.5 s, INP good <= 200 ms, CLS good <= 0.1 (75th percentile).
Set explicit width and height (or aspect-ratio) on images and reserve space for embeds to prevent layout shift.
Lazy-load below-the-fold images with loading="lazy"; never lazy-load the LCP hero image.
Use responsive images via the breakpoints and responsive_image modules so srcset/sizes match viewport and DPR.
Aggregate and compress CSS/JS in production; Drupal's aggregate settings combine files to cut request count.
WCAG 2.2 AA targets: 4.5:1 contrast for normal text, 3:1 for large text and UI components; target size minimum 24x24 CSS px.
Every image needs an alt attribute; decorative images use alt="" so screen readers skip them.
Landmarks and headings: one h1 per page, logical heading order, and semantic elements (nav, main, header, footer) for landmark navigation.
Keyboard operability requires visible focus indicators and no keyboard traps; custom widgets need ARIA roles and states.
Fundamental Web Development Concepts
HTTP is stateless: each request/response pair is independent unless state is carried by cookies, sessions, or tokens.
Status code classes: 2xx success, 3xx redirection, 4xx client error, 5xx server error; 304 means the cached copy is still valid.
Cache-Control directives: no-store forbids caching, no-cache requires revalidation, max-age sets freshness lifetime in seconds, immutable skips revalidation.
GET is safe and idempotent; POST is neither; PUT and DELETE are idempotent but not safe.
DOM is a tree of nodes; CSSOM is built from stylesheets; render tree = visible DOM nodes combined with computed styles.
Critical rendering path order: HTML parse, CSS fetch/parse, render-blocking stop, layout, paint, composite.
Same-origin policy compares scheme, host, and port; CORS response headers (Access-Control-Allow-Origin) relax it for cross-origin fetches.
Progressive enhancement layers semantic HTML first, then CSS, then JavaScript, so core content works without scripting.
Drupal Theming Fundamentals
Theme discovery scans /themes and /themes/custom; a theme requires an .info.yml file whose name matches the directory name.
Base theme is declared with the base theme key in .info.yml; a theme without it is a base theme itself.
Template suggestion order runs from most specific to most general; the first suggestion found in the registry wins.
Preprocess functions run in order: modules first, then the base theme, then the active subtheme, so the subtheme can override earlier values.
Twig debug (twig.config debug: true in services.yml) enables the HTML comment listing theme hook and candidate template names.
Libraries are declared in libraries.yml and attached via {{ attach_library() }}, a #attached render array property, or the theme's info.yml libraries key.
Regions are declared under the regions key in .info.yml; page.html.twig prints them with {{ page.regionname }}.
Classy was the Drupal 8 base theme; from Drupal 10 its templates were merged into Stable 9, which is the default base theme.
Twig Templating
{{ }} outputs an expression; {% %} executes a tag; {# #} is a comment that produces no output.
Autoescaping is on by default for HTML contexts; use |raw only for trusted markup and |t for translatable strings.
Filters transform values (|upper, |length, |date, |without, |clean_class); functions return values (attach_library(), url(), path(), dump()).
Attribute objects are printed directly (e.g. {{ attributes }}) so core-added classes and data attributes are preserved.
Whitespace control uses {%- and -%} to trim adjacent whitespace in rendered output.
Twig templates map to theme hooks: node.html.twig for nodes, field.html.twig for fields, block.html.twig for blocks.
The loop variable inside {% for %} exposes index, index0, first, last, and length.
{{ dump() }} requires Twig debug mode; it is a development aid and must not ship to production.
Theme Development Best Practices
Override templates in the subtheme rather than editing contrib or core; subtheme paths take precedence in the suggestion chain.
Use single directory components or a components directory with co-located Twig, CSS, and JS to keep markup and styles together.
Namespace CSS classes with a component prefix (BEM-style block__element--modifier) to avoid collisions across templates.
Never hardcode paths or text: use {{ url() }} / {{ path() }} for links and |t or |trans for user-facing strings.
Escape output by default; reserve |raw for markup generated or sanitized by trusted code.
Declare JS and CSS dependencies in libraries.yml with dependencies keys so load order is deterministic.
Keep logic in preprocess functions and plugins; Twig should hold presentation decisions only.
Use stable cache metadata (cache tags, contexts, max-age) on render arrays so theming changes do not break caching.
Front End Performance and Accessibility
Core Web Vitals thresholds: LCP good <= 2.5 s, INP good <= 200 ms, CLS good <= 0.1 (75th percentile).
Set explicit width and height (or aspect-ratio) on images and reserve space for embeds to prevent layout shift.
Lazy-load below-the-fold images with loading="lazy"; never lazy-load the LCP hero image.
Use responsive images via the breakpoints and responsive_image modules so srcset/sizes match viewport and DPR.
Aggregate and compress CSS/JS in production; Drupal's aggregate settings combine files to cut request count.
WCAG 2.2 AA targets: 4.5:1 contrast for normal text, 3:1 for large text and UI components; target size minimum 24x24 CSS px.
Every image needs an alt attribute; decorative images use alt="" so screen readers skip them.
Landmarks and headings: one h1 per page, logical heading order, and semantic elements (nav, main, header, footer) for landmark navigation.
Keyboard operability requires visible focus indicators and no keyboard traps; custom widgets need ARIA roles and states.
Fundamental Web Development Concepts
HTTP is stateless: each request/response pair is independent unless state is carried by cookies, sessions, or tokens.
Status code classes: 2xx success, 3xx redirection, 4xx client error, 5xx server error; 304 means the cached copy is still valid.
Cache-Control directives: no-store forbids caching, no-cache requires revalidation, max-age sets freshness lifetime in seconds, immutable skips revalidation.
GET is safe and idempotent; POST is neither; PUT and DELETE are idempotent but not safe.
DOM is a tree of nodes; CSSOM is built from stylesheets; render tree = visible DOM nodes combined with computed styles.
Critical rendering path order: HTML parse, CSS fetch/parse, render-blocking stop, layout, paint, composite.
Same-origin policy compares scheme, host, and port; CORS response headers (Access-Control-Allow-Origin) relax it for cross-origin fetches.
Progressive enhancement layers semantic HTML first, then CSS, then JavaScript, so core content works without scripting.
Drupal Theming Fundamentals
Theme discovery scans /themes and /themes/custom; a theme requires an .info.yml file whose name matches the directory name.
Base theme is declared with the base theme key in .info.yml; a theme without it is a base theme itself.
Template suggestion order runs from most specific to most general; the first suggestion found in the registry wins.
Preprocess functions run in order: modules first, then the base theme, then the active subtheme, so the subtheme can override earlier values.
Twig debug (twig.config debug: true in services.yml) enables the HTML comment listing theme hook and candidate template names.
Libraries are declared in libraries.yml and attached via {{ attach_library() }}, a #attached render array property, or the theme's info.yml libraries key.
Regions are declared under the regions key in .info.yml; page.html.twig prints them with {{ page.regionname }}.
Classy was the Drupal 8 base theme; from Drupal 10 its templates were merged into Stable 9, which is the default base theme.
Twig Templating
{{ }} outputs an expression; {% %} executes a tag; {# #} is a comment that produces no output.
Autoescaping is on by default for HTML contexts; use |raw only for trusted markup and |t for translatable strings.
Filters transform values (|upper, |length, |date, |without, |clean_class); functions return values (attach_library(), url(), path(), dump()).
Attribute objects are printed directly (e.g. {{ attributes }}) so core-added classes and data attributes are preserved.
Whitespace control uses {%- and -%} to trim adjacent whitespace in rendered output.
Twig templates map to theme hooks: node.html.twig for nodes, field.html.twig for fields, block.html.twig for blocks.
The loop variable inside {% for %} exposes index, index0, first, last, and length.
{{ dump() }} requires Twig debug mode; it is a development aid and must not ship to production.
Theme Development Best Practices
Override templates in the subtheme rather than editing contrib or core; subtheme paths take precedence in the suggestion chain.
Use single directory components or a components directory with co-located Twig, CSS, and JS to keep markup and styles together.
Namespace CSS classes with a component prefix (BEM-style block__element--modifier) to avoid collisions across templates.
Never hardcode paths or text: use {{ url() }} / {{ path() }} for links and |t or |trans for user-facing strings.
Escape output by default; reserve |raw for markup generated or sanitized by trusted code.
Declare JS and CSS dependencies in libraries.yml with dependencies keys so load order is deterministic.
Keep logic in preprocess functions and plugins; Twig should hold presentation decisions only.
Use stable cache metadata (cache tags, contexts, max-age) on render arrays so theming changes do not break caching.
Front End Performance and Accessibility
Core Web Vitals thresholds: LCP good <= 2.5 s, INP good <= 200 ms, CLS good <= 0.1 (75th percentile).
Set explicit width and height (or aspect-ratio) on images and reserve space for embeds to prevent layout shift.
Lazy-load below-the-fold images with loading="lazy"; never lazy-load the LCP hero image.
Use responsive images via the breakpoints and responsive_image modules so srcset/sizes match viewport and DPR.
Aggregate and compress CSS/JS in production; Drupal's aggregate settings combine files to cut request count.
WCAG 2.2 AA targets: 4.5:1 contrast for normal text, 3:1 for large text and UI components; target size minimum 24x24 CSS px.
Every image needs an alt attribute; decorative images use alt="" so screen readers skip them.
Landmarks and headings: one h1 per page, logical heading order, and semantic elements (nav, main, header, footer) for landmark navigation.
Keyboard operability requires visible focus indicators and no keyboard traps; custom widgets need ARIA roles and states.