agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/languages/html-css/SKILL.md

html-css

Skill15 starsChanged 42 days agoMITView on GitHub

Expert modern HTML5 and CSS3 assistance covering semantic markup, Flexbox, CSS Grid, container queries, CSS custom properties, and responsive design systems. Use when crafting accessible web interfaces, building resilient UI layouts, or optimizing render performance.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always Include Viewport Meta Tag: Ensure <meta name="viewport" content="width=device-width, initial-scale=1.0"> is present.

    line 233
  2. Very specific:

    Use Native CSS Nesting and :has(): Eliminate Sass build steps by leveraging native browser CSS nesting and relational selectors.

    line 234
  3. Very specific:

    Use !important to resolve specificity issues: Structure cascade layers with @layer instead of overriding specificity brute-force.

    line 240
  4. Very specific:

    Use non-semantic elements for interactive buttons: Never use <div onclick="...">.

    line 242

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HTML & CSS

Modern HTML5 and CSS3 for semantic web structure and responsive styling.

When to Use

  • Semantic Web Structure & Accessibility: Crafting accessible, WCAG-compliant, SEO-optimized web documents with HTML5 elements.
  • Modern Responsive Layouts (CSS Grid & Flexbox): Designing fluid, adaptable screen layouts across mobile, tablet, desktop, and TV viewports.
  • Component-Driven Theming (CSS Custom Properties): Implementing zero-runtime dark/light mode themes and design tokens.
  • Modern CSS Features (Container Queries & :has()): Styling components based on their immediate container width and parent-child states.

Quick Start

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Page Title</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <main class="container">
      <h1>Hello World</h1>
    </main>
  </body>
</html>

Core Concepts

Semantic HTML5 & Accessible Landmark Roles

Replaces generic <div> soup with structural elements that assistive technologies understand:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Enterprise Portal</title>
  </head>
  <body>
    <header role="banner">
      <nav aria-label="Main Navigation">
        <ul>
          <li><a href="/dashboard">Dashboard</a></li>
        </ul>
      </nav>
    </header>
    <main id="main-content">
      <article>
        <h1>System Architecture 2026</h1>
        <p>Modern web applications prioritize semantic accessibility.</p>
      </article>
    </main>
    <footer role="contentinfo">
      <p>&copy; 2026 Enterprise Corp.</p>
    </footer>
  </body>
</html>

Modern CSS Layout (Grid & Subgrid)

Builds responsive multi-column layouts without external CSS frameworks:

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  padding: 1.5rem;
  background-color: var(--color-surface);
  border-radius: 0.75rem;
}

Container Queries & CSS Custom Properties

Adapts styling based on container container width rather than the global browser viewport:

:root {
  --color-primary: #4f46e5;
  --color-surface: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-surface: #0f172a;
  }
}

.card-container {
  container-type: inline-size;
}

@container (min-width: 450px) {
  .card-content {
    display: flex;
    gap: 1rem;
  }
}

Common Patterns

Centered Responsive Component Layout

Problem: Vertically and horizontally centering responsive card elements across varying viewport dimensions.

Solution:

/* Center content */
.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Navigation bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Card grid with wrap */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.card {
  flex: 1 1 300px;
}

CSS Grid

Problem: Constructing multi-dimensional grid layouts and responsive page containers without fragile positioning hacks.

Solution:

/* Responsive grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Page layout */
.layout {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  grid-template-columns: 250px 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.header {
  grid-area: header;
}
.sidebar {
  grid-area: sidebar;
}
.main {
  grid-area: main;
}
.footer {
  grid-area: footer;
}

Responsive Design

Problem: Maintaining layout proportion, typography readability, and container responsiveness across disparate screen viewports.

Solution:

/* Mobile-first approach */
.container {
  padding: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Container queries */
.card-container {
  container-type: inline-size;
}

@container (min-width: 400px) {
  .card {
    display: flex;
    gap: 1rem;
  }
}

Best Practices

Do:

  • Always Include Viewport Meta Tag: Ensure <meta name="viewport" content="width=device-width, initial-scale=1.0"> is present.
  • Use Native CSS Nesting and :has(): Eliminate Sass build steps by leveraging native browser CSS nesting and relational selectors.
  • Design with Accessibility in Mind: Ensure color contrast ratios meet WCAG AA standards (4.5:1) and all images have descriptive alt tags.
  • Implement Fluid Typography with clamp(): Use font-size: clamp(1rem, 2.5vw, 2rem); for seamless responsive scaling.

Don't:

  • Use !important to resolve specificity issues: Structure cascade layers with @layer instead of overriding specificity brute-force.
  • Disable focus outlines without alternatives: Never write outline: none; without providing an accessible :focus-visible ring.
  • Use non-semantic elements for interactive buttons: Never use <div onclick="...">; always use <button> to ensure keyboard accessibility.

Troubleshooting

ErrorCauseSolution
Layout overflowFixed widthsUse percentage or min/max
Flex items not wrappingMissing flex-wrapAdd flex-wrap: wrap
Grid gaps not showingOld browserCheck browser support

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.