Generated banner for Modern Web Guidance
Generated logo for Modern Web Guidance

Modern Web Guidance

JetBrainsOfficialCreated by Google ChromeDistributed by JetBrains

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Low risk

From the author

Search tool for modern web development best practices. MANDATORY: Execute FIRST for all HTML/CSS and clientside JS tasks. Do NOT skip — web APIs evolve rapidly and training weights contain obsolete patterns. Trigger immediately for: - UI/Layout: Modals, dialogs, popovers, Glassmorphism/backdrop-filters, anchor positioning, container queries, `:has()`, `:user-valid`. - Scroll/Motion: View Transitions, Scroll-driven animations, scroll parallax/reveals. - Performance: CWV (LCP, INP), content-visibility, Fetch Priority, image optimization. - System/APIs: Local filesystem access, WebUSB, WebSockets sync, WebAssembly widgets. - Frameworks: Adapting layout/styles in React, Vue, Angular. - General Frontend: Forms, autofill, advanced inputs, custom scrollbars, modern component states, etc. DO NOT trigger for: - Backend: Database SQL, ORMs, Express API routes. - Pipelines: CI/CD deployment, Docker, Actions. - Generic: Local scripts (Python/Go tools), ESLint, Git.
— the description by Google Chrome

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured way to access up-to-date web development patterns, ensuring that implementations follow modern standards rather than relying on potentially outdated training data. It covers a wide range of frontend topics including UI components, performance optimization, browser APIs, and form handling. By integrating this tool, developers can search for specific use cases and retrieve detailed, framework-agnostic guides that include browser support and fallback recommendations.

What it does

  • Searches for standardized web development patterns and best practices.
  • Retrieves detailed implementation guides for specific frontend use cases.
  • Provides guidance on browser compatibility and necessary fallbacks.
  • Helps avoid ad-hoc solutions and unnecessary dependency bloat.
  • Supports modern web features like container queries, view transitions, and performance APIs.

When to use it

  • At the beginning of any frontend feature implementation.
  • Before creating new components to check for existing standardized patterns.
  • When evaluating the browser support requirements for modern web features.
  • When needing to implement performance optimizations like LCP or content-visibility.

Advantages

  • Ensures use of current, recommended web development practices.
  • Reduces technical debt by discouraging ad-hoc implementations.
  • Provides clear guidance on handling browser compatibility and fallbacks.
  • Promotes the use of native browser capabilities over heavy external dependencies.

Usage examples

“I need to implement a modal using modern web standards. What is the best approach?”
The agent searches for modal-related guides and retrieves the recommended implementation pattern, including any necessary browser fallbacks.
“How can I optimize the loading priority of my LCP images?”
The agent searches for image optimization guides and retrieves the specific instructions for using fetch priority to improve performance.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/jetbrains/modern-web-guidance/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip modern-web-guidance.zip -d .agents/skills

Documentation by Google Chrome

Modern Web Guidance

A skill to search for specific web development use cases and retrieve their corresponding best practice guides.

When to use

Must use this skill:

  • At the start of implementing any web feature.

  • Before creating a new component, to check if a standardized pattern already exists.

  • To avoid implementing ad-hoc solutions or loading large dependencies unnecessarily.

Usage Instructions

Step 1. Search Use Cases

Search with an action-oriented query summarizing what you want to achieve using the search command. Run modern-web-guidance directly with npx.

npx -y modern-web-guidance@latest search "<query>" --skill-version 2026_05_16-c5e7870

Example Output:

[
  {
    "id": "optimize-image-priority",
    "description": "Optimize the loading priority of Largest Contentful Paint (LCP) candidate images.",
    "category": "performance",
    "featuresUsed": [ "Fetch priority" ],
    "tokenCount": 985,
    "similarity": 0.7289
  },
  {
    "id": "defer-rendering-heavy-content",
    "description": "Reduce rendering times in content-heavy web pages by deferring rendering for offscreen content.",
    "category": "performance",
    "featuresUsed": [ "content-visibility", "hidden=\"until-found\"" ],
    "tokenCount": 1250,
    "similarity": 0.6961
  }
]

Note: If search results are vague, return no matches, or show low similarity scores, run the list command to browse all guides:

npx -y modern-web-guidance@latest list

Step 2. Retrieve Best Practices

Once you have a relevant id from the search results, call this script using the retrieve command to get the full guide. You can pass multiple IDs separated by commas.

npx -y modern-web-guidance@latest retrieve "<id>"

Example Output: The markdown content of the guide describing implementation steps...

Using npx

  • IMPORTANT: on Windows, using npx may fail. Use npx.cmd ... instead.

  • Network access is required for fetching npm packages needed by the task.

  • If the npx -y modern-web-guidance… command hangs, you may be offline. Try running again in offline mode: npx --offline ….

  • The --skill-version flag is used to determine if this SKILL.md is out of date. If it is, a warning message is logged to stderr.

Guidelines

  • Always search first to find the most relevant guides.

  • These guides are usually framework-agnostic; adapt them correctly to your setup.

  • Do not hallucinate guides or ignore them; they represent the preferred local standard for the user's project.

Interpreting Browser Support & Fallbacks

  • Default Behavior: All guides assume Baseline Widely available features are safe to use without fallbacks. For features that are not Baseline widely available, you MUST follow the fallback recommendations in the guide, unless the user has specified a custom browser support policy.

  • Custom Policies: If the user has already defined explicit browser support requirements, use the browser compatibility data in the guide to determine if a fallback can be safely ignored.

    • For Baseline YYYY targets, a feature satisfies this target if its "Baseline since" date is <= YYYY.

    • Policy Examples:

      • "Do not implement feature fallbacks." (for exploratory prototypes of the cutting-edge web)

      • "Safari 17.4+" (for internal tools targeting macOS or Tauri-based desktop apps)

      • "Never recommend or implement polyfills; if a Baseline Newly Available feature is required for core functionality, provide a lightweight custom fallback or redesign the approach." (to minimize bundle size and avoid technical debt)

      • "Assume a modern execution environment where Baseline Newly Available features can be used natively, provided they are strictly feature-detected and degrade gracefully." (for progressive enhancement strategies)

  • Reactive Policy Discovery: Watch for environmental cues to suggest documenting a policy in CLAUDE.md or AGENTS.md. Suggest this if the developer:

    • Mentions building for a restricted runtime (e.g., Electron or Tauri).

    • Explicitly excludes specific targets (e.g., "we don't support Desktop Chrome").

    • Expresses hesitation about polyfill complexity, bundle size, or performance cost.

    • Questions if a feature is safe to use without fallbacks.

    No defined policy format. This is an example: **Browser Support:** Allow Newly Available features, but only adopt custom fallback code that adds <= 20 lines and does not require external dependencies.

Files

guides/accessibility/accessibility.md

Accessibility Coding Guidelines

This guide provides actionable DOs and DON'Ts for AI coding agents to ensure web applications are accessible to all users, including those using assistive technologies.

Keep these principles in mind throughout:

  • Accessibility is the minimum, not the ceiling. Conformance to standards is the floor; aim for genuine usability.

  • Patterns are use-case specific. No checklist replaces real testing — including testing with disabled users — to confirm a given implementation is actually accessible in context.

1. Content Navigability and Structure

Actionable Guidelines
DOs
  • Place all content within landmarks: Wrap the page in <header>, <nav>, <main>, <aside>, and <footer> so assistive-tech users can jump between regions.

  • Structure main content with headings: Use <h1>–<h6> sequentially (no jumping <h1> → <h4>) so screen-reader users get a navigable outline.

  • Use lists for repeated, contiguous content: <ul>/<ol> give assistive tech a count up front and let users skip the entire group.

  • Provide skip links prior to repeated content like site headers with navigation or long/infinite lists, so that keyboard users can easily bypass them. Make sure the target is focusable (e.g. <main id="content" tabindex="-1">).

  • Semantic Tables: Use <caption> and <th scope="col"> (or <th scope="row">) for data tables.

DON'Ts
  • Don't use fake headings: Never style <div> or <span> to look like headings without standard <h1>–<h6> tags.

  • Don't place headings inside <summary>, and avoid relying on headings inside <details> content: Headings inside <summary> may be hidden from screen-reader heading lists and heading-navigation shortcuts entirely; headings inside <details> content are only reachable via heading navigation when the disclosure is open.

    • Caveat: If a heading must act as a disclosure trigger, use a more robust alternative to <details>/<summary> instead, e.g. an accordion or a disclosure implemented with ARIA where the heading wraps the button.

  • Don't use tables for layout: Use CSS Grid/Flexbox for visual layouts.

  • Don't overuse landmarks: Too many landmarks dilute their value. In particular, avoid labeling a <section> (which turns it into a region landmark) — region should be a last resort when no other landmark fits.

Code Examples
<!-- Good: Semantic landmarks, heading hierarchy, skip link -->
<header>
  <a href="#content" class="skip-link visually-hidden">Skip to content</a>
  <nav aria-label="Primary">
    <ul>
      <li><a href="/">Home</a></li>
    </ul>
  </nav>
</header>
<main id="content" tabindex="-1">
  <h1>Platform Dashboard</h1>
  <section>
    <h2>User Statistics</h2>
    <table>
      <caption>Monthly active users</caption>
      <tr>
        <th scope="col">Month</th>
        <th scope="col">Users</th>
      </tr>
      <tr>
        <td>January</td>
        <td>12,000</td>
      </tr>
    </table>
  </section>
</main>

2. Semantic HTML and ARIA

Actionable Guidelines
DOs
  • Prefer HTML elements and attributes to ARIA: A native element comes with the right role and behavior. <button> already implies role="button"; required already implies aria-required.

  • Match ARIA implementations to actual behavior: If you set role="tab", the element must behave like a tab — including keyboard interactions. Many ARIA patterns can't be implemented in CSS alone and need JavaScript.

  • Be deliberate about disabled vs aria-disabled: disabled removes the element from the focus order entirely (and tabindex="0" won't bring it back), which is often wrong for toolbar buttons or links. aria-disabled="true" keeps the element focusable so users can land on it and learn it's disabled.

DON'Ts
  • Don't use ARIA when native HTML exists: Avoid <div role="button"> or <a role="button"> if <button> works.

  • Don't add redundant ARIA roles or properties: Avoid <ul role="list">, <nav role="navigation">, or <input required aria-required="true">.

    • Caveat: Safari removes list semantics from <ul>/<ol> outside <nav> when list-style: none or display: flex/grid is applied. In that case role="list" is required to restore them.

  • Don't assume custom elements have no ARIA: Custom elements can attach ARIA via ElementInternals, which some automated test tools can't see — so the absence of role/aria-* attributes in markup doesn't prove the element has no semantics. Verify with the browser's accessibility-tree inspector.

3. Accessible Names and Descriptions

Every interactive element and some landmarks need an accessible name, and many benefit from an accessible description. Names are short and identify the element; descriptions add context.

Actionable Guidelines
DOs
  • Prefer native naming mechanisms: <label> for form controls, <caption> for <table>, <legend> for <fieldset>, <figcaption> for <figure>.

  • Explicitly associate <label> with its control via for/id, even when nesting the input inside the label — explicit association improves assistive-tech support.

  • Prefer aria-labelledby over aria-label when a visible label exists: avoids duplication, improves maintainability, and translates better.

  • Prefer to reuse the same accessible name for hyperlinks that share an href.

  • Use visually hidden text to disambiguate controls that look identical visually but do different things (e.g. multiple "Edit" buttons in a list).

DON'Ts
  • Don't put aria-label/aria-labelledby on elements that shouldn't be named — e.g. plain <div>, <span>, or custom elements without a role. Custom elements may have an implicit role set via ElementInternals, so the absence of a role attribute isn't conclusive.

  • Don't reuse an accessible name across controls with different effects in the same view (close buttons for two different open dialogs are fine because only one is reachable at a time; multiple “Edit” buttons for different content is not).

  • Don't reuse an accessible name across hyperlinks pointing to different hrefs.

  • Don't pack descriptions, error messages, or instructions into the label.

  • Don't repeat state already exposed via ARIA (aria-expanded, aria-checked, aria-selected, aria-pressed) inside the accessible name — it creates redundancy and ambiguity.

  • Don't include the role name in the label: <nav aria-label="Primary navigation"> reads as "Primary navigation navigation."

  • Don't use title or placeholder as a naming mechanism.

  • Don't include interactive elements in an aria-describedby target unless their text content reads sensibly as a description on its own (e.g. if a link’s text is the same as how it’s labelled elsewhere, it can be included within a description).

Code Example: Visually Hidden Utility

A .visually-hidden utility lets you provide text for screen readers without rendering it visually. It's commonly used for skip links, additional context on icon-only buttons, and supplementary labels.

/* Hides content visually but keeps it in the accessibility tree.
   :focus-within / :active opt elements out — useful for skip links and
   any focusable content wrapped in this class. */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

When the hidden content is focusable (skip links, focus-receiving wrappers), the :focus-within/:active exception lets it become visible. Style the visible state per situation, e.g. a skip link to the main content typically wants fixed positioning at the top-left of the viewport so the rest of the page doesn't shift.

4. Document Metadata and Language

Actionable Guidelines
DOs
  • Declare Visual Language: Always set <html lang="en"> (or appropriate code).

  • Unique Page Titles: Front-load unique context in <title> (e.g., Page Topic | Site Name).

  • Inline Language Switches: Use lang="..." for block quotes or text in different languages.

  • IFrame Titles: Always provide a descriptive title="..." for <iframe> elements.

  • Update document title on Page Transitions in SPAs: Shift focus to updated titles.

DON'Ts
  • Don't Disable iframe Scrolling: Avoid scrolling="no" (deprecated) or overflow: hidden on iframes. Users who zoom in or enlarge text need to scroll to reach content that overflows.

Code Examples
<!-- Good: Distinct title and language declaration -->
<html lang="en">
<head>
  <title>Analytics Reports | Guidance Platform</title>
</head>
<body>
  <p>The motto is <span lang="la">"Carpe diem"</span>.</p>
  <iframe title="Interactive Sales Chart" src="/chart"></iframe>
</body>
</html>

5. Keyboard and Focus Management

Actionable Guidelines
DOs
  • Logical Tab Order: Ensure tab order matches visual layouts (top-to-bottom).

  • Visible Focus Indicators: Always style :focus-visible states explicitly. If disabling defaults, provide overrides with sufficient contrast.

  • Custom Trigger Keyboards: Attach Enter/Space handlers for custom simulated interactive elements. When implementing a custom keyboard handler for button-like elements, Enter should be a keydown handler and Space should be a keyup handler (matching native <button> behavior where Enter repeats and Space triggers on release).

  • Use tabindex deliberately: Anything focusable — by keyboard or programmatically — should have an implicit or explicit ARIA role, so don't make every element focusable. When focus is needed, choose tabindex="0" to add the element to the tab order or tabindex="-1" to make it programmatically focusable only (e.g., a skip-link target).

  • Manage Toggle States: Utilize aria-expanded and aria-pressed to communicate toggle states for custom controls.

DON'Ts
  • Don't disable outlines without replacements: Avoid outline: none without styling alternatives.

  • Don't use Positive Tabindex values: Never use tabindex="1" or greater.

  • Don't hide interactive elements from screen readers: Avoid aria-hidden="true" or role="presentation" on elements that can receive focus.

Code Examples
/* Good: High contrast focus border */
:where(a:any-link, button):focus-visible {
  outline: 3px solid #ff0055;
  outline-offset: 3px;
}
<!-- Good: Skip to main content -->
<a href="#content" class="skip-link">Skip to main content</a>
<main id="content" tabindex="-1">...</main>
// Good: Keyboard handlers for complex custom widgets (e.g., Tree items, tabs).
// NOTE: This pattern applies ONLY to non-standard UI where no native HTML tag exists.
// Always prioritize native <button> or <input> elements for standard interactions.
// Elements MUST have the appropriate ARIA role (e.g., role="treeitem" or role="tab").
customWidget.addEventListener('keydown', (e) => {
  if (e.key === 'Enter') {
    toggleWidgetState();
  }
  if (e.key === ' ') {
    e.preventDefault(); // Prevent page scrolling on Spacebar keydown
  }
});

customWidget.addEventListener('keyup', (e) => {
  if (e.key === ' ') {
    toggleWidgetState();
  }
});

function toggleWidgetState() {
  // E.g., Manage toggle/expanded states for custom controls
  const isExpanded = customWidget.getAttribute('aria-expanded') === 'true';
  customWidget.setAttribute('aria-expanded', !isExpanded);
}

6. Alternate Text and Media

Actionable Guidelines
DOs
  • Informative Visual Descriptions: Describe the purpose of the image (e.g., "Search", not "Magnifying glass").

  • Empty Alt properties for decorative visuals: Use alt="" to remove decorative images from the accessibility tree so they aren't announced.

  • Synchronous Captions for videos: Supply WebVTT captions for video tracks.

  • Transcripts for audio: Provide text transcripts for purely audio podcasts.

  • Informative View Descriptions for inline SVGs: Apply role="img" and a nested <title> tag for informative visuals.

  • Decorative SVGs removal: Apply aria-hidden="true" to remove decorative SVGs from reading flows.

  • Long descriptions for complex images: Use <figure>/<figcaption> or aria-describedby for charts and infographics.

  • Provide data tables as alternatives: Consider providing semantic data tables as accessible alternatives for charts and other complex data visualizations.

DON'Ts
  • Don't use clichéd prefixes: Avoid "Image of..." or "Picture of...".

  • Don't use underscores in filenames: Use dashes if the filename might be announced as fallback.

Code Examples
<!-- Decorative -->
<img src="divider.png" alt="">

<!-- Inline Decorative SVG (remove from tab flow) -->
<svg aria-hidden="true" viewBox="0 0 24 24">
  <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
</svg>

<!-- Informative (Functional) -->
<a href="/search">
  <img src="glass.png" alt="Search the platform">
</a>

<!-- Video with Captions tracks -->
<video controls>
  <source src="intro.mp4" type="video/mp4">
  <track src="caps.vtt" kind="captions" srclang="en" label="English">
</video>

<!-- Complex graph with figcaption -->
<figure>
  <img src="chart.png" alt="Sales growth graph 2024.">
  <figcaption>Sales grew 20% in Q3 due to new platform launch.</figcaption>
</figure>

<!-- Audio with expandable transcript details -->
<audio controls src="podcast.mp3" aria-details="podcast-transcript"></audio>
<details id="podcast-transcript">
  <summary>View Transcript</summary>
  <div class="transcript-content">
    Welcome to the show...
  </div>
</details>
Content Visibility Decision Matrix
IntentVisualScreen ReaderFocusableStructural Pattern
Visible to allYesYesYesStandard rendering
Screen Reader onlyNoYesYes (if interactive)Visually hidden utility (e.g. .visually-hidden)
Visual onlyYesNoNoaria-hidden="true" / role="presentation"
Hidden for allNoNoNohidden attribute / display: none

Heuristic Rule: If an element can receive keyboard focus, it must not be hidden via aria-hidden="true".

7. Forms and Input Controls

Actionable Guidelines
DOs
  • Connect Labels Programmatically: Use <label for="id"> linked to <input id="id">.

  • Use Autocomplete: Set valid standard autocomplete options (e.g., "email" or "given-name") for user profiles.

  • Link hints to inputs via aria-describedby: Associate help text with inputs, and place the hint above the input so autocomplete popovers don't cover it during editing.

  • Announce dynamic errors via live regions: Use aria-live or shift focus to error lists.

  • Provide form validation constraints: Use required (or aria-required="true" only when required isn't applicable) to signal mandatory inputs.

DON'Ts
  • Don't use placeholders as labels: Placeholders are not persistent labels.

  • Don't trigger context shifts on focus changes: Avoid auto-submitting forms or jumping pages on focus change events alone.

Code Examples
<!-- Good: Semantic forms with hints for passwords -->
<form>
  <label for="pwd">Password:</label>
  <span id="pwd-hint">Must contain at least 8 characters.</span>
  <input id="pwd" type="password" aria-describedby="pwd-hint" autocomplete="current-password" required>
</form>

8. Live Regions

Live regions let assistive tech announce content updates that aren't tied to navigation or focus changes. They're easy to misuse — too many regions, or noisy ones, quickly become spam for screen-reader users.

Live Region Urgency Table
UrgencyVisual Analoguearia-live ValueBehavioral ImpactExample
CriticalModal / Alertassertive (or role="alert")Interrupts immediately, clears speech queueSession timeout, API failure
StandardToast / BannerpoliteAnnounces at next graceful breakSearch results, "Saved" status
PassiveSilent textoffOnly if user navigates to itLive character count

Heuristic Rule: Use assertive only for critical, time-sensitive updates that require immediate attention or prevent safe continuation (e.g., data loss, session timeouts, or network drops).

Actionable Guidelines
DOs
  • Centralize live regions for non-visible announcements: A single polite region and a single assertive region per page (with whatever aria-atomic configuration you need) keeps announcements consistent and easier to maintain. Many frameworks ship their own announcer abstraction — use it.

  • Debounce frequently-changing regions: If a region can update many times per second (e.g. a combobox's result count as the user types), debounce so users aren't spammed.

  • Delay slightly when other announcements may collide: When the user is typing or focus is being managed, a small delay before announcing keeps live-region updates from overlapping other speech.

DON'Ts
  • Don't use live regions for interstitial states like "Loading…" or "Updating…" unless they're meaningfully informative — they usually just create noise.

  • Don't add live-region updates to inert DOM: When dialogs open or sections become inert, queued or debounced messages can end up unannounced — or announced from DOM the user can't reach. Coordinate live-region updates with dialog/inert state changes.

Code Example
<!-- Session Timeout Warning with controls -->
<div role="alert" aria-live="assertive" class="timeout-warning">
  Your session will expire in 2 minutes. 
  <button onclick="extendSession()">Extend Session</button>
</div>

9. Color, Contrast, and Typography

Actionable Guidelines
DOs
  • Minimum contrast standards: Maintain 4.5:1 for normal text and 3:1 for large text or icons.

  • Ensure non-text contrast standards: Maintain a minimum contrast ratio of 3:1 for user interface component boundaries and states.

    • This includes visual elements (borders, backgrounds, box-shadows, underlines) that form the boundary or indicate the presence of a UI component (e.g., input field borders).

    • This also includes visual elements indicating active states within a component (e.g., checkbox checkmarks or switch thumbs).

    • Caveat: Meeting 3:1 non-text contrast can challenge minimalistic designs. Soft gradients or subtle inset/outset shadows can soften visual boundaries while satisfying accessibility requirements.

  • Use multiple state indicators: Do not denote success/errors ONLY with color. Use icons or text.

  • Relative font size units: Use rem or em for font sizes instead of px.

  • Consistent or Start alignment: Avoid justify alignment as it can be more difficult to read.

  • Avoid long lines of text: Cap paragraph blocks to a maximum of 80 characters width.

  • Support user zoom preferences: Allow users to resize text up to 200% without loss of content or functionality.

  • Support light and dark color schemes: Honor @media (prefers-color-scheme: dark) and pair it with the color-scheme CSS property so form controls, scrollbars, and other UA-rendered surfaces match.

  • Use prefers-contrast only when warranted: Reach for @media (prefers-contrast: more) when the design uses low-contrast accents (e.g., subtle borders, muted secondary text) that need to be reinforced; most sites that already meet baseline contrast won't need it.

DON'Ts
  • Don't use color alone to indicate the presence of a user interface component or its state: Use iconography and/or shape to help differentiate.

  • Don't use Justified Text Alignment: Avoid text-align: justify.

  • Don't use Ornate fonts: Omit cursive typefaces for main reading content.

  • Don't rely on all-caps for emphasis: Prefer bolding for visual emphasis, and use <em>/<strong> when the emphasis is semantic.

  • Limit emphasis overall: Emphasis loses meaning when it's everywhere — apply it only where it changes how the content should be read.

Code Examples
/* Good: Relative sizing and line caps */
body {
  line-height: 1.5;
  text-align: start; /* Supports LTR and RTL */
}
article {
  max-width: 80ch; /* Caps line length to ~80 characters for readability */
}
<!-- Good: Denotes state without colors alone -->
<div class="error-msg">
  <span aria-hidden="true">❌</span>
  <span>The password entered was invalid.</span>
</div>
/* Dark Mode support variables */
:root {
  --bg-color: #ffffff;
  --text-color: #212529;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #f8f9fa;
  }
}

10. Motions and Preferences

Actionable Guidelines
DOs
  • Support Reduced Motion media queries: Support @media (prefers-reduced-motion: reduce) media queries.

  • Provide Pause mechanism: Allow users to stop auto-running carousels banners or other persistent animations.

  • Default to static views: Consider defaulting to static states and allowing users to opt-in to motion.

DON'Ts
  • Don't exceed flash limits (three per second): Never include rapid light-to-dark flashing. Such effects can cause seizures.

Code Examples
/* Good: Dampen spin states for reduced motion queries */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    opacity: 0.5;
  }
}

11. Modals and Native Dialogs

Modern browsers provide native solutions for creating modal dialogs which avoid the need for focus traps, managing the accessibility of outside content, ensuring the content is on top, and dimming the background content — all of which can be error prone and require heavy JavaScript event tracking to maintain.

Actionable Guidelines
DOs
  • Use the Native <dialog> Element: Invoke the dialog using the .showModal() method to open it in a modal state. When in a modal state, the browser sets outside content as inert (i.e. the outside content is hidden from the accessibility tree and cannot be interacted with nor be focused).

  • Use the inert Attribute for Custom Overlays: When <dialog> cannot be used (e.g., some non-modal overlays, framework constraints, or layouts where <dialog>'s top-layer/positioning behavior conflicts with the design), apply inert to outside content to ensure it cannot be interacted with by keyboard, pointer, or assistive technology. This requires structuring elements in such a way that the custom overlay is not a descendant of the element with inert set on it.

DON'Ts
  • Don't implement focus traps for native modal dialogs: When a <dialog> element is opened in a modal state, browsers set outside content as inert which is sufficient for ensuring only the dialog’s content can be focused.

Code Examples

HTML & JS: Native <dialog> with standard close events

<!-- Dialog opens natively with showModal() and locks focus -->
<button id="open-btn">Open Dialog</button>

<dialog id="accessible-modal" aria-labelledby="title-id">
  <h2 id="title-id">Account Settings</h2>
  <p>Update your details here.</p>
  <button onclick="this.closest('dialog').close()">Close Dialog</button>
</dialog>

<script>
  document.getElementById('open-btn').addEventListener('click', () => {
    document.getElementById('accessible-modal').showModal();
  });
</script>

12. Testing Validations

Actionable Guidelines
DOs
  • Run Automated checks via axe-core or Lighthouse audits: Catch missing alt texts or low contrasts (e.g., via Lighthouse in Chrome DevTools MCP).

  • Validate Sequential Navigations using keyboards alone: Using only keyboard shortcuts, such as Tab/Shift+Tab, arrow keys, Enter, Space, and Esc, confirm every interactive element is reachable and operable, and that focus never gets stuck.

  • Test on Screen Readers with calibrated browsers: Rely on standard bindings (e.g., JAWS with Chrome, NVDA with Firefox, Narrator with Edge, VoiceOver with Safari on macOS and iOS, TalkBack with Chrome for Android).

DON'Ts
  • Don't rely purely on scores: A 100% score does not guarantee real usability.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Google Chrome
Publisher
JetBrains (Official)
Distributed by
JetBrains
Source
JetBrains/skills · modern-web-guidance · commit 3f53782
Licence
Apache License 2.0 (redistribution allowed)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google Chrome or JetBrains.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download modern-web-guidance.zip