Bukwild Stylus Library

3.2.1 · active · verified Sun Apr 19

Bukwild Stylus Library is a collection of opinionated utility mixins, functions, and global conventions designed for Stylus CSS preprocessor projects. It aims to streamline development by providing pre-built solutions for common CSS patterns, particularly focusing on responsive design with its `fluid()` mixin for scaling property values. The library is currently at version 3.2.1. While Stylus itself has had periods of uncertainty regarding maintenance, this library appears to be actively maintained, with a recent update (v3.2.1) published in February 2022. Its key differentiators include the advanced `fluid()` mixin for complex responsive scaling and the provision of `boilerplate.styl` for quick setup with Bukwild's internal conventions. It is specifically built for Stylus, differentiating it from Sass or Less-based utility collections.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the main Stylus library and utilize the `fluid()` mixin for responsive scaling of CSS properties and custom properties.

// my-project.styl
@import "~bukwild-stylus-library/index.styl";

// Define some base variables if needed, otherwise library defaults apply
// fluid-default-max-break = 1440px // Default in v3.0.0+
// fluid-default-min-break = 375px

.my-responsive-element
  font-size: 16px;
  // Scales padding from 20px (at 1440px viewport) down to 10px (at 375px viewport)
  fluid padding, 20, 10;

.my-custom-breakpoint-element
  margin-top: 50px;
  // Scales margin-top from 30px (at 1024px viewport) down to 15px (at 768px viewport)
  fluid(margin-top, 30, 15, min-break: 768px, max-break: 1024px);

// Using fluid with CSS custom properties (variables)
:root
  fluid(--site-padding, 40, 20); // Scale a custom property

.header
  padding: var(--site-padding);
  background: lightblue;

.footer
  padding: calc(var(--site-padding) / 2);
  background: lightgray;

view raw JSON →