Socket
Book a DemoInstallSign in
Socket

@felix_berlin/sass-butler

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@felix_berlin/sass-butler

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

3.1.0
latest
Source
npmnpm
Version published
Weekly downloads
93
-42.94%
Maintainers
1
Weekly downloads
 
Created
Source

SASS Butler

Stands by your side with plenty of features and mixins.

npm GitHub Downloads (all assets, all releases) 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.79.0 or above.

Sass support

Sass CompilerSupport
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

Keywords

scss

FAQs

Package last updated on 13 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.