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

@internetstiftelsen/styleguide

v3.0.18

Published

The styleguide is a set of components that follows the Atomic Design methodology and is powered by Fractal. It is built to be fully modular so one can include only what is needed when using the styleguide.

Downloads

2,199

Readme

Internetstiftelsen Styleguide

The styleguide is a set of components that follows the Atomic Design methodology and is powered by Fractal. It is built to be fully modular so one can include only what is needed when using the styleguide.

Usage

To use the styleguide in your website or interface you need to install the styleguide and then decide which components you need.

To install it, run npm i @internetstiftelsen/styleguide.

When that's done, you need to configure your build. So open up your main SCSS file and add the components you need like this:

// Configurations, foundation, fonts, utilities etc..
@import '~@internetstiftelsen/styleguide/src/globals';

// Set a project namespace for namespace prefixed classes
$namespace: 'mysite-';

// Configuration/Base components
@import '~@internetstiftelsen/styleguide/src/configuration/grid/grid';
@import '~@internetstiftelsen/styleguide/src/configuration/colors/colors';

// Atoms
@import '~@internetstiftelsen/styleguide/src/atoms/button/button';
@import '~@internetstiftelsen/styleguide/src/atoms/input/input';

// Molecules
@import '~@internetstiftelsen/styleguide/src/molecules/card/card';

// Organisms
@import '~@internetstiftelsen/styleguide/src/organisms/header/header';

Peek into the app.scss to see the full set of components.

For javascript it's basically the same thing. In a javascript file:

// ES5 build version (path "dist")
import Button from '@internetstiftelsen/styleguide/dist/atoms/button/button';

// Standard ES6 version (path "src")
import Button from '@internetstiftelsen/styleguide/src/atoms/button/button';

// Globals and Configuration/Base components are imported by default from the Styleguide Core

// Atoms
import '@internetstiftelsen/styleguide/src/atoms/button/button';
import '@internetstiftelsen/styleguide/src/atoms/input/input';

// Molecules
import '@internetstiftelsen/styleguide/src/molecules/card/card';

// Organisms
import '~@internetstiftelsen/styleguide/src/organisms/header/header';

SCSS Mixins explained:

@include e(nested-element) {} // Element (.parent-element__nested-element)
@include m(modifier-name) {} // Modifier (.parent-element--modifier-name)
	@include b(block-name) {} // Block (.block-name)

Depending on your browser requirements you may use the src version which is not transpiled to ES5.

Setup

Be sure to include the following features in your setup.

A no-js/js class to the HTML-element

Add the class no-js as default and a javascript that switches that to js e.g. below. Some styles are relying on this class to properly display tab highlighting but of course it can be handy in many other cases too.

<html class="no-js"
<script type="text/javascript">
	document.querySelector('html').classList.remove('no-js');
	document.querySelector('html').className += 'js';
</script>

Tab Highlighting

Add Tab Highlighting to your site. This ensures clear visual focus styles when navigating the site by tabbing. https://github.com/sewebb/iis-styleguide/tree/master/src/utilities/tab-highlighting

Skip navigation

Add a "skip navigation" to your site. This navigation should contain anchor links to allow users to easily skip to and passed repeating content that is included on every page such as header and main navigation. https://styleguide.internetstiftelsen.se/components/detail/skip.html

Development

Before you start, make sure you read and understand our coding standards and conventions.

  1. Install dependencies with npm install.
  2. Run npm run dev

This will watch the files you edit and automatically start the dev environment. The code is validated and fixed on save using our coding standards and convention

Deployment

To be able to deploy you need to build a static version of the styleguide. The command npm run build will build the static site in the build directory in the root of the your project. NOTE: Always run this command before pushing your to git.