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

@penskemediacorp/larva-scss

v1.62.0

Published

Larva SCSS authoring tools.

Downloads

1,746

Readme

Larva SCSS

Note: As of 8.7.0-alpha, the recommended approach for class generation is NOT to use these generators, but to directly iterate over a map of tokens add rulesets within that loop.

This repository holds core SCSS tools and tokens for Larva. These include:

  • Breakpoint mixin
  • Variables (e.g. spacing, color, z-index, and transition values)
  • Generators (i.e. mixins that generate classes according to a list of tokens) NOT RECOMMENDED FOR UTILITIES

This repository provides Sass files only. The consuming project is responsible for building the assets.

Usage

Import a SCSS file for tools or tokens to use them in your project.

Available Tools

Breakpoint Mixin

The breakpoint mixin includes breakpoints for the following:

  • mobile-max = (max-width: 767px)
  • tablet = (min-width: 768px)
  • desktop = (min-width: 1000px)
  • desktop-xl = (min-width: 1260px)
// assets/src/patterns/07-utilities/u-display.scss
@import '@penskemediacorp/larva-scss/dist/tools';

.u-display-none\@tablet {
	@include pmc-breakpoint( tablet ) {
		display: none;
	}
}

Rem Mixin

// assets/src/patterns/07-utilities/u-width.scss
@import '@penskemediacorp/larva-scss/dist/tools';

.u-max-width-600 {
	max-width: pmc-rem(600);
}

Tokens

Refer to the directory lib/tokens in this package to see what tokens (a.k.a. Sass variables) are available to use.

You can import the file in a Larva project and use the tokens like this:

// assets/src/patterns/06-algorithms/a-specific-grid.scss
@import '@penskemediacorp/larva-scss/dist/tokens';

.a-specific-grid {
	display: grid;
	grid-template-columns: repeat( 1fr, 3 );
	grid-gap: $spacer-150;
}

.a-specific-grid__top-bar {
	margin-top: $spacer-2;
	grid-column: 1 / -1;
}

Generators

For example, if you need to add grids that are not available in larva-css, you can use the grid algorithm generator. In a new file, assets/src/patterns/06-algorithms/a-grid.scss, add the following:

// assets/src/patterns/06-algorithms/a-grid.scss
@import '@penskemediacorp/larva-scss/dist/generators';

$grids: (
	(
		columns: 6,
		spans: ( 2, 3, ),
		breakpoint: tablet,
	),
);

@include a-grid( $grids );

Utility generators are used the same way, but added inside the utilities directory, instead, and indicate a simple, property: value declaration. To add additional colors to a consuming project, for example, add the following:

// assets/src/patterns/07-utilities/u-background.scss

@import '@penskemediacorp/larva-scss/dist/generators';
@import '@penskemediacorp/larva-scss/dist/tokens';

$color_list: (
	blue: $color-blue-30,
	blue-light: $color-blue-80,
);

@include token-utility-generator( $color_list );