CSS Helper Framework

1.0.2 · active · verified Sun Apr 19

style-helpers is a lightweight CSS utility library providing a collection of pre-defined classes and mixins to streamline common styling tasks for front-end development. It offers solutions for flexbox layouts, animations, button styling, and spacing, aiming to reduce boilerplate CSS. The library is currently at stable version 1.0.2. Given its evolution from 0.x to 1.x and the minimal changelog provided for recent minor versions, it appears to have a relatively slow or infrequent release cadence. Its key differentiator lies in offering a direct, pre-packaged set of common CSS patterns, making it easy to integrate into projects using SCSS or by direct HTML link, focusing on quick application of common styles rather than a full component system.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to include `style-helpers` via an HTML link tag and apply some of its utility classes like `is-flex`, `is-flex-center`, `is-m-1` for margin, and `is-button` for styling a button.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Style Helpers Quickstart</title>
  <!-- Link to the style-helpers CSS file -->
  <!-- For development, you can link directly from node_modules if served statically -->
  <link href="./node_modules/style-helpers/style-helpers.css" rel="stylesheet" type="text/css">
  <style>
    body {
      font-family: sans-serif;
      padding: 20px;
    }
    .my-card {
      border: 1px solid #eee;
      padding: 20px;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      background-color: white;
    }
  </style>
</head>
<body>

  <div class="is-flex is-flex-center is-flex-align-items-center is-flex-wrap is-m-2" style="min-height: 200px; background-color: #f9f9f9;">
    <div class="my-card is-m-1">
      <h1 class="is-m-0">Hello World!</h1>
      <p>This is a paragraph with default styling.</p>
      <button class="is-button is-button-primary">Primary Button</button>
    </div>
    <div class="my-card is-m-1">
      <p class="is-m-0">Another card demonstrating flexbox and spacing helpers.</p>
      <button class="is-button">Default Button</button>
      <p class="is-m-t-2 has-fade-in">Fades in after load!</p>
    </div>
  </div>

</body>
</html>

view raw JSON →