![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
@maggioli-design-system/styles
Advanced tools
Readme
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
.
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
The first part to be included are the design tokens, like color palette and typography, that are used by the 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));
}
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);
}
our color palette already supports dark mode, either according to your computer settings, or with manual support:
Just add the dark-mode
class to the html
tag:
<html class="dark-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.
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'),
],
}
Use @fontsource
fonts, which are up to date with Google fonts, styles used in Magma Design System are:
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'
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.
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 |
FAQs
This module contains SCSS and CSS styles used by Maggioli Design System, it also makes available a Tailwind config based on Maggioli design tokens.
The npm package @maggioli-design-system/styles receives a total of 1,903 weekly downloads. As such, @maggioli-design-system/styles popularity was classified as popular.
We found that @maggioli-design-system/styles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.