Basscss Type Scale

1.0.6 · maintenance · verified Sun Apr 19

basscss-type-scale is a utility CSS package that provides a set of font-size utilities, enabling developers to apply a consistent type scale using atomic classes like `.h1` through `.h6`. It is a module within the broader Basscss ecosystem, which is a low-level CSS toolkit emphasizing small, composable, and utility-first CSS. The package is currently at version `1.0.6`. The core Basscss project reached `v8` in February 2016 and is considered "feature complete," meaning it is stable with no planned major breaking changes or new features. This implies `basscss-type-scale` is also in a maintenance state. It differentiates itself by providing a flexible way to visually scale font sizes independent of semantic HTML elements, promoting consistency in component-based UI architectures without altering the document structure.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to include and use the Basscss type scale utility classes in an HTML document to apply consistent font sizes to various elements.

<!-- Include Basscss type scale CSS in your HTML file (e.g., via CDN or local build) -->
<!-- For local usage in a project with a bundler, you would typically `import 'basscss-type-scale/css/basscss-type-scale.css';` in your main JS/TS entry file -->

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Basscss Type Scale Example</title>
  <!-- Example: Linking directly from node_modules for illustration, or a build output -->
  <link rel="stylesheet" href="./node_modules/basscss-type-scale/css/basscss-type-scale.css">
  <!-- If using the full Basscss, it might be: -->
  <!-- <link rel="stylesheet" href="https://unpkg.com/basscss@8.0.2/css/basscss.min.css"> -->
</head>
<body>
  <h1>Semantic H1</h1>
  <p class="h1">Pastrami 1 - Visually an h1, but semantically a paragraph.</p>

  <h2>Semantic H2</h2>
  <p class="h2">Pastrami 2 - Visually an h2, but semantically a paragraph.</p>

  <h2 class="h1">Larger than default h2 style, but semantically correct.</h2>
  <p class="h3">Pastrami 3</p>
  <p class="h4">Pastrami 4</p>
  <p class="h5">Pastrami 5</p>
  <p class="h6">Pastrami 6</p>
</body>
</html>

view raw JSON →