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

@mangoweb/sass-base

v0.0.8

Published

The manGoweb template for sass styles employed on small to medium sized projects.

Downloads

114

Readme

@mangoweb/sass-base

The manGoweb template for sass styles employed on small to medium sized projects. It defines abstract definitions, animation keyframes, functions, mixins, a global reset as well as a couple of other utility classes.

Installation

npm install @mangoweb/sass-base

⚠️ You might want to also fix the package version so that any potential future backwards incompatibilities don't break your build. This package is generally intended for live development with the occasional BC break. Should that affect your application because you failed to fix the version, that's on you.

Usage

Basic use

If you don't wish to modify anything, just import everything:

@import '~@mangoweb/sass-base/index'

More advanced use

To gain a finer control over what and how is imported, you might want to follow these steps:

  1. Create a _variable.sass file from which you can override any variable defined in ~@mangoweb/sass-base/variables.

  2. Create a _common.sass file:

    @import 'variables'
    @import '~@mangoweb/sass-base/common'

    This allows you to define your variables before you import sass-base, thereby overriding its defaults.

    You should later import this file from all your other files (e.g. other components) in order to avoid relying on implicit importing.

  3. Create an index.sass file:

    @import 'common'
    @import '~@mangoweb/sass-base/index'
       
    /* Any other components of yours */
    @import 'parts/…'

Defined functions

em

Turns a (potentially unitless) number in pixels into em

Usage:

  • em(16) returns 1em (based on $font-size)
  • em(16px) returns 1em (based on $font-size)
  • em(10px) returns .625em (based on $font-size)
  • em(10px, 10px) returns 1em where $font-size is the second parameter which defaults to $base-font-size, which is typically 16px.

rem

Turns a (potentially unitless) number in pixels into rem

Usage:

  • rem(16) returns 1rem (based on $base-font-size)
  • rem(16px) returns 1rem (based on $base-font-size)

toScalar

Converts a dimensioned value to a scalar

line-height: toScalar(1.5em) // line-height: 1.5

Defined mixins

absolute

Usage:

  • +absolute(top right bottom left)
  • +absolute(top horizontal bottom)
  • +absolute(vertical horizontal)
  • +absolute(offset)

Examples:

  • +absolute(1px 2px 3px 4px) compiles to // position: absolute; top: 1px; right: 2px; bottom: 3px; left: 4px
  • +absolute(1px 2px 3px) compiles to // position: absolute; top: 1px; right: 2px; bottom: 3px; left: 2px
  • +absolute(1px 2px) compiles to // position: absolute; top: 1px; right: 2px; bottom: 1px; left: 2px
  • +absolute(1px) compiles to // position: absolute; top: 1px; right: 1px; bottom: 1px; left: 1px
  • +absolute(1px null null 2px) compiles to // position: absolute; top: 1px; left: 2px

All the other position mixins (fixed, relative, sticky) behave identically

clearFix

Just a simple clear fix

fixed

See absolute

fluid

Signature: fluid($property-name, $min-viewport-width, $max-viewport-width, $min-value, $max-value)

Allows you to set a property value to a linearly interpolated value with respect to the viewport width.

Example:

.foo
	+fluid(font-size, 0em, 45em, 0em, 1.5em)

media

A helper mixin for @media queries

Usage:

+media(mediaQuery [, mediaQuery]*)
	foo: bar
	/* … */

where mediaQuery is a sass list of one of

  • string of a classic css feature query
  • unitless number (will be interpreted as the pixel argument for min-width)
  • number with a special unit prefix 'M' (e.g. 123Mem) which denotes that max-width is to be emitted NOTE: You never want to use this unit explicitly. Instead, use the maxWidth function for conversion. See examples below.

Examples:

  • +media($break480 $break768M, $break992 $break1200M) compiles to @media (min-width: 30em) and (max-width: 47.96875em), (min-width: 62em) and (max-width: 74.96875em)
  • +media(123) compiles to @media (min-width: 7.6875em)
  • +media(123M) compiles to @media (max-width: 123px)
  • +media(123em maxWidth(456em)) compiles to @media (min-width: 123em) and (max-width: 455.96875em)
  • +media($break480 '(screen)', 300 maxWidth(500px), $landscape) compiles to @media (min-width: 30em) and (screen), (min-width: 18.75em) and (max-width: 31.21875em), (orientation: landscape)

relative

See absolute

size

Usage

+size(100%) // width: 100%; height: 100%
+size(123px 456px) // width: 123px; height: 456px

sticky

See absolute

Defined variables

There are more to list here. Please refer to _variables.sass.