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

@maggioli-design-system/styles

v15.4.0

Published

This module contains SCSS and CSS styles used by Maggioli Design System, it also makes available a Tailwind config based on Maggioli design tokens.

Downloads

20,141

Readme

@maggioli-design-system/styles

These are the CSS and Tailwind styles used by components libraries of Magma Design System to use the palette generated by @maggioli-design-system/design-tokens.

Installation

Install the component via npm by running the following command:

npm i @maggioli-design-system/styles

This package works also with yarn:

yarn add @maggioli-design-system/styles

Integration

CSS

The first part to be included are the design tokens, like color palette and typography, that are used by the components.

Colors with tailwind or web components

If you use tailwind or web components, you need to import rgb format of colors:

import '@maggioli-design-system/styles/dist/css/colors-rgb-tones.css';
import '@maggioli-design-system/styles/dist/css/colors-rgb-status.css';
import '@maggioli-design-system/styles/dist/css/colors-rgb-label.css';
import '@maggioli-design-system/styles/dist/css/colors-rgb-brand.css';

You need to import colors because web components and our tailwind config works with our palette, which are custom properties in rgb format (rr, gg, bb).

If for some reason you need to use colors outside tailwind:

.selector {
  color: rgb(var(--tone-neutral-01));
}

Hex colors

If you need just the hex format of colors, you can import them like this:

import '@maggioli-design-system/styles/dist/css/colors-hex-tones.css';
import '@maggioli-design-system/styles/dist/css/colors-hex-status.css';
import '@maggioli-design-system/styles/dist/css/colors-hex-label.css';
import '@maggioli-design-system/styles/dist/css/colors-hex-brand.css';

Then you can use them like this:

.selector {
  color: var(--tone-neutral-01);
}

Dark mode format

our color palette already supports dark mode, either according to your computer settings, or with manual support:

Manual mode

Just add the dark-mode class to the html tag:

<html class="dark-mode">

OS settings mode

Just add the system-mode class to the html tag:

<html class="system-mode">

There are other practices to handle dark mode, check how tailwind handle dark mode, or how is handled by next-themes.


Tailwindcss config

You can use styles with tailwindcss config, palette colors and the rest of it's Design Tokens. There are various ways to use it, check out tailwindcss documentation.

To extend the default tailwind config:

module.exports = {
  content: [
    './src/**/*.{ts,tsx}',
  ],
  important: false,
  presets: [
    require('@maggioli-design-system/styles'),
  ],
}

Fonts

Use @fontsource fonts, which are up to date with Google fonts, styles used in Magma Design System are:

TypeScript

Importing fonts in TypeScript:


```ts
import '@fontsource/karla/400.css'
import '@fontsource/karla/700.css'
import '@fontsource/merriweather/400.css'
import '@fontsource/merriweather/700.css'
import '@fontsource/roboto-mono/400.css'
import '@fontsource/roboto/500.css'
import '@fontsource/roboto/700.css'
import '@fontsource/roboto/900.css'

CSS

Importing fonts in CSS:

@import '@fontsource/karla/400.css';
@import '@fontsource/karla/700.css';
@import '@fontsource/merriweather/400.css';
@import '@fontsource/merriweather/700.css';
@import '@fontsource/roboto-mono/400.css';
@import '@fontsource/roboto/500.css';
@import '@fontsource/roboto/700.css';
@import '@fontsource/roboto/900.css';

Fontsource supports variable fonts.


Dist folder

The dist folder contains the following files:

| Folder | For | File name | | --------- | ----------- | ----------- | | css | both | globals.css | | css | both | reset.css | | css | plain css | base.css | | css | plain css | colors-hex-*.css | | css | plain css | typography.css | | css | tailwind or web components | colors-rgb-*.css | | tailwind | tailwind | base.css | | tailwind | tailwind components | components.css | | tailwind | tailwind typography components | typography.css |