Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub

CSS Layouts & Typography (@methane-ui/css)

Structural layout containers, editorial prose styles, and landing sections written in pure CSS inside @layer mth.primitives. They work immediately on HTML and custom tags without JavaScript and adapt automatically to light, dark, density, and high-contrast modes.

.mth-stack.mth-grid.mth-flex.mth-container.mth-aspect-ratio.mth-sticky.mth-divider.mth-spacer.mth-app-shell.mth-sidebar-layout.mth-bento-grid.mth-prose.mth-dl.mth-hero.mth-feature-grid.mth-testimonial.mth-logo-cloud.mth-footer.mth-faq.mth-article-layout.mth-pricing-table.mth-cta.mth-announcement-bar

Layout

Stack

.mth-stack, mth-stack
@methane-ui/css/layout.css

Vertical or horizontal flex stack with token-driven gap, alignment, and justification.

When NOT to use: Do not use for 2D grid tracks or asymmetric dashboards; use .mth-grid or .mth-bento-grid instead.
Item A
Item B
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<mth-stack data-gap="4">
  <div>First</div>
  <div>Second</div>
</mth-stack>

Grid

.mth-grid, mth-grid
@methane-ui/css/layout.css

Auto-fit responsive CSS Grid with explicit column presets and subgrid row alignment.

When NOT to use: Do not use when you need drag-and-drop column resizing or virtualized scrolling; use <mth-table> or @methane-ui/datagrid.
1
2
3
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<mth-grid data-columns="3" data-gap="4">
  <div>Cell 1</div>
  <div>Cell 2</div>
  <div>Cell 3</div>
</mth-grid>

Flex

.mth-flex, mth-flex
@methane-ui/css/layout.css

Wrapping inline cluster or row layout for toolbars, badges, and action groups.

When NOT to use: Do not use for keyboard-roving toolbar navigation; pair with <mth-button-group> when arrow-key roving focus is required.
Cluster Start Cluster End
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<mth-flex data-gap="3" data-justify="between">
  <span>Title</span>
  <button type="button">Action</button>
</mth-flex>

Container

.mth-container, mth-container
@methane-ui/css/layout.css

Centered inline-size container establishing container-type: inline-size for child queries.

When NOT to use: Do not nest multiple .mth-container elements with inline padding unless you explicitly reset --mth-container-padding.
Centered container (max 40rem)
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<mth-container data-size="lg">
  <p>Content bounded to 75rem.</p>
</mth-container>

Aspect Ratio

.mth-aspect-ratio
@methane-ui/css/layout.css

Intrinsic aspect-ratio frame (1/1, 4/3, 16/9, 21/9) sizing child media cleanly.

When NOT to use: Do not use for interactive zoom/pan or cropping workflows; use <mth-image-cropper> or <mth-zoom-pan>.
21:9 Frame
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<div class="mth-aspect-ratio" data-ratio="16/9">
  <img src="/poster.jpg" alt="Preview" />
</div>

Sticky

.mth-sticky
@methane-ui/css/layout.css

Logical inset-block-start / inset-block-end sticky positioning using --mth-z-index-sticky.

When NOT to use: Do not use for modal dialogs, drawers, or popovers that require top-layer Escape handling; use <mth-dialog> or <mth-popover>.
Sticky bar (inset-block-start: 0)
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<header class="mth-sticky">
  <nav>Sticky header</nav>
</header>

Divider

.mth-divider
@methane-ui/css/layout.css

Horizontal or vertical hairline separator with optional centered inline label.

When NOT to use: Do not use inside a Shadow DOM listbox or menu where an explicit semantic <hr> / role="separator" item is managed by ListboxController.
OR
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<div class="mth-divider" role="separator">OR</div>

Spacer

.mth-spacer, mth-spacer
@methane-ui/css/layout.css

Flexible or token-sized empty spacer for flex and stack layouts.

When NOT to use: Do not use spacers for uniform sibling gaps; set data-gap on .mth-stack or .mth-flex instead.
LeftRight
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<mth-flex>
  <span>Brand</span>
  <mth-spacer></mth-spacer>
  <a href="/login">Sign in</a>
</mth-flex>

App Shell

.mth-app-shell
@methane-ui/css/layout.css

Container-responsive 5-region application shell (header, sidebar, main, aside, footer).

When NOT to use: Do not use when the user needs drag-resizable split panes; use <mth-split-pane> or <mth-resizable-group>.
Header
Sidebar
Main
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<div class="mth-app-shell">
  <header class="mth-app-shell-header">Header</header>
  <nav class="mth-app-shell-sidebar">Nav</nav>
  <main class="mth-app-shell-main">Content</main>
  <footer class="mth-app-shell-footer">Footer</footer>
</div>

Sidebar Layout

.mth-sidebar-layout
@methane-ui/css/layout.css

Intrinsic wrapping sidebar + fluid main panel that collapses without media queries.

When NOT to use: Do not use for mobile slide-over navigation drawers; pair with <mth-drawer> for off-canvas menus.
Sidebar
Main Content
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<div class="mth-sidebar-layout">
  <aside>Filters</aside>
  <section>Results</section>
</div>

Bento Grid

.mth-bento-grid
@methane-ui/css/layout.css

Dense asymmetric CSS Grid with container-responsive span attributes and surface cards.

When NOT to use: Do not use for variable-height Pinterest masonry; use <mth-masonry> when strict column packing is required.
Featured Cell
Cell
<link rel="stylesheet" href="@methane-ui/css/layout.css" />
<div class="mth-bento-grid">
  <article class="mth-bento-item" data-span="2">Highlight</article>
  <article class="mth-bento-item">Metric</article>
</div>

Typography & Surface

Prose

.mth-prose
@methane-ui/css/prose.css

Long-form editorial typography rhythm for headings, lists, blockquotes, code, and tables.

When NOT to use: Do not inject untrusted HTML into .mth-prose without sanitizing first via @methane-ui/sanitize.

Clean editorial rhythm with inline code and logical spacing.

<link rel="stylesheet" href="@methane-ui/css/prose.css" />
<article class="mth-prose">
  <h1>Article Title</h1>
  <p>Readable 65ch measure with logical spacing.</p>
</article>

Description List

.mth-dl
@methane-ui/css/prose.css

Container-responsive key-value <dl> with stacked and bordered variants.

When NOT to use: Do not use for sortable or selectable multi-column datasets; use <mth-table> or @methane-ui/datagrid.
License
MIT
JS Runtime
0 bytes
<link rel="stylesheet" href="@methane-ui/css/prose.css" />
<dl class="mth-dl" data-variant="bordered">
  <dt>Status</dt>
  <dd>Operational</dd>
</dl>

Content & Marketing

Hero

.mth-hero
@methane-ui/css/marketing.css

Container-responsive marketing hero supporting centered and split layouts.

When NOT to use: Do not use inside dense admin dashboards; reserve .mth-hero for landing and product pages.
Pure CSS Hero

Zero-JS Hero Block

Instant SSR with container-query scale.

<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<section class="mth-hero" data-align="center">
  <div class="mth-hero-content">
    <span class="mth-hero-eyebrow">Methane UI</span>
    <h1 class="mth-hero-title">Build Fast</h1>
    <p class="mth-hero-lead">Pure CSS layouts and typography.</p>
  </div>
</section>

Feature Grid

.mth-feature-grid
@methane-ui/css/marketing.css

Auto-fit grid of feature cards with semantic icon tiles and forced-colors safety.

When NOT to use: Do not use for interactive selectable option cards in forms; use <mth-radio-group> or <mth-toggle-group>.
★Zero FOUC
⚡Logical CSS
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<div class="mth-feature-grid">
  <article class="mth-feature-card">
    <span class="mth-feature-icon">★</span>
    <h3>Accessible</h3>
    <p>Same-root ARIA & forced-colors safe.</p>
  </article>
</div>

Testimonial

.mth-testimonial
@methane-ui/css/marketing.css

Accessible <figure> quote block with logical inline-start accent border and attribution.

When NOT to use: Do not use for live interactive chat/comment threads; use @methane-ui/chat <mth-chat-thread>.
“Zero hydration overhead on static content.”
— Platform Team
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<figure class="mth-testimonial">
  <blockquote>“Cleanest SSR story we have shipped.”</blockquote>
  <figcaption class="mth-testimonial-author">— Engineering Lead</figcaption>
</figure>

Logo Cloud

.mth-logo-cloud
@methane-ui/css/marketing.css

Uniform partner logo grid with smooth hover emphasis and reduced-motion/forced-colors support.

When NOT to use: Do not use for interactive image carousels; use <mth-carousel> when pagination controls are needed.
AcmeGlobexInitech
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<div class="mth-logo-cloud">
  <img src="/logo-a.svg" alt="Partner A" />
  <img src="/logo-b.svg" alt="Partner B" />
</div>

FAQ Accordion

.mth-faq
@methane-ui/css/marketing.css

Progressive zero-JS exclusive accordion powered by native <details name="...">.

When NOT to use: Do not use when programmatic expand-all, custom ARIA tree/accordion keyboard arrow navigation, or form state is required; use <mth-accordion>.
Does .mth-faq require JavaScript?

No — native <details name="..."> handles exclusive toggling natively.

Is it forced-colors safe?

Yes — uses Canvas, CanvasText, and ButtonBorder in high-contrast mode.

<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<div class="mth-faq">
  <details name="faq">
    <summary>Question 1</summary>
    <p>Answer 1</p>
  </details>
  <details name="faq">
    <summary>Question 2</summary>
    <p>Answer 2</p>
  </details>
</div>

Article Layout

.mth-article-layout
@methane-ui/css/marketing.css

Two-column editorial grid with sticky table-of-contents aside at wide container widths.

When NOT to use: Do not use for multi-pane IDE/workspace layouts; use .mth-app-shell or <mth-split-pane>.
Article Body
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<div class="mth-article-layout">
  <header class="mth-article-header"><h1>Title</h1></header>
  <article class="mth-article-body mth-prose"><p>Body</p></article>
  <aside class="mth-article-aside">On this page</aside>
</div>

Pricing Table

.mth-pricing-table
@methane-ui/css/marketing.css

Responsive pricing tier grid with featured tier highlight and forced-colors outline.

When NOT to use: Do not use for interactive plan-selection forms or billing checkout steps; use @methane-ui/commerce <mth-plan-picker>.
Free
$0
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<div class="mth-pricing-table">
  <section class="mth-pricing-tier">...</section>
  <section class="mth-pricing-tier mth-pricing-featured">...</section>
</div>

Call to Action

.mth-cta
@methane-ui/css/marketing.css

High-impact call-to-action banner with subtle and accent variants.

When NOT to use: Do not use for dismissible system alerts or inline validation errors; use <mth-alert> or <mth-callout>.
Ready to ship Methane? Get Started →
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<section class="mth-cta" data-variant="accent">
  <div><h2>Start building</h2><p>Zero runtime CSS primitives.</p></div>
  <div class="mth-cta-actions"><a href="/quickstart">Get Started</a></div>
</section>

Announcement Bar

.mth-announcement-bar
@methane-ui/css/marketing.css

Compact top-of-page announcement strip with accent and warning variants.

When NOT to use: Do not use for transient notifications or dismissible banners with ARIA live announcements; use <mth-toast> or <mth-banner>.
New: Methane v1.0 Foundation is live!
<link rel="stylesheet" href="@methane-ui/css/marketing.css" />
<div class="mth-announcement-bar" data-variant="accent">
  <span>Methane v1.0 released — read the guide.</span>
</div>