npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@felix_berlin/sass-butler

v3.0.1

Published

A collection of useful SCSS/SASS: mixins, functions and helpers.

Downloads

618

Readme

SASS Butler

Stands by your side with plenty of features and mixins.

npm npm (scoped) GitHub package.json version GitHub Workflow Status (branch) GitHub Workflow Status GitHub Workflow Status GitHub code size in bytes

SASS Butler is a big collection of SASS mixins and functions.

Mixins and functions are unit tested via Jest and True. Unfortunately, it is not yet possible to create a coverage report.

Whats inside?

Visit https://sass-butler.kasimir.dev for full documentation.

Functions

Mixins

Installation

pnpm add @felix_berlin/sass-butler

npm i @felix_berlin/sass-butler

yarn add @felix_berlin/sass-butler

If you haven't already, install Sass.

pnpm add -D sass

npm i -D sass

yarn add -D sass

Requirements

This project uses the "new" Sass Module system. Therefore your build tool or taskrunner have to support Dart Sass 1.33.0 or above.

Sass support

| Sass Compiler | Support | | ------------- | ------- | | Dart Sass | ✅ | | Lib Sass | ❌ | | Ruby Sass | ⚰️ |

Version support

Your Dart Sass Version must be: >= 1.33.0

Usage

Import all at once or all individually

Single import of the used functionalities.

@use './node_modules/sass-butler/functions/first-of-list' as fol;

import all functions at once:

@use './node_modules/sass-butler/functions' as fn;

How to import

@use './node_modules/sass-butler/mixis/breakpoint' as breakpoint;

With sass-loader:

@use '~sass-butler/mixis/breakpoint' as breakpoint;

With webpack mix:

  .sass('resources/assets/styles/app.scss', 'styles', {
    sassOptions: {
      includePaths: ['./node_modules'],
    },
  })
@use 'sass-butler/mixis/breakpoint' as breakpoint;

Override module config

Some of the module comes with "global" config vars and maps (breakpoint mixin). This may be a problem since you can only overwrite once with with(). Here is an example how you can deal with it.

Redefine mixin or function default configs

Example how to use the breakpoint mixin with own default config:

Create a new file and load the breakpoint mixin from the node_modules with the @forward function. Similar to the @use function you can overwrite predefined vars with with().

// _custom-breakpoints.scss

@forward 'sass-butler/mixins/breakpoint' with (
  // Add your own breakpoints map
  $breakpoints: (
    'xxs': 375px,
    'xs': 568px,
    'sm': 768px,
    'md': 1024px,
    'lg': 1260px,
    'xlg': 1440px,
    'fhd': 1920px,
    'uhd': 2560px
  )
);

In the rest of your project you don't add the module via node_modules anymore but load the customized module _external.scss with @use.

// _my-module.scss

@use 'custom-breakpoints' as break;

.my-selector {
  @include break.breakpoint(lg) {
    padding: 12px 0 1rem 0;
  }
}

:warning: Pay attention to the loading order when using redefined and package function/mixins!

:x: Can't be compiled because the (package) breakpoint mixin is already loaded in mixins.scss.

@use 'sass-butler/mixins' as mx;
@use 'custom-breakpoints' as break;

:white_check_mark: This will work. Make sure to load the redefined module first.

@use 'custom-breakpoints' as break;
@use 'sass-butler/mixins' as mx;

Documentation

You can find the documentation at: https://sass-butler.kasimir.dev

The documentation is updated automatically with each commit on the master branch.

Build the docs locally

Run following command: npm run sassDoc

Contributors