Skip to content

Arbeidstilsynet/design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

719 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@arbeidstilsynet/design

npm (react) npm (css) npm (theme) Quality Gate Status

Gnist, the Norwegian Labour Inspection Authority's design system, based on designsystemet.no.

Storybook: gnist.arbeidstilsynet.no

Packages

Usage

npm i @arbeidstilsynet/design-react @arbeidstilsynet/design-css @arbeidstilsynet/design-theme

// layout.tsx or other top level component.
// These only have to be imported once.
import "@arbeidstilsynet/design-css";
import "@arbeidstilsynet/design-theme";
// myComponent.tsx
import { Button } from "@arbeidstilsynet/design-react";

export function MyComponent() {
  return (
    <div>
      <Button variant="primary">Click me</Button>
    </div>
  );
}

Font (optional)

The design system is developed with the fonts Inter and Literata, but you can choose any font.

Example

/* globals.css */
body {
  font-family: "Inter", sans-serif;
  font-feature-settings: "cv05" 1; /* Enable lowercase l with tail */
}
// layout.tsx or other top level component
export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <head>
        <link
          rel="preconnect"
          href="https://at-static.arbeidstilsynet.no"
          crossOrigin=""
        />
        <link
          rel="stylesheet"
          href="https://at-static.arbeidstilsynet.no/fonts/inter/v4.1/inter.css"
          crossOrigin=""
        />
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
        <link
          rel="stylesheet"
          href="https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,200..900;1,7..72,200..900&display=swap"
        />
      </head>
      <body>{children}</body>
    </html>
  );
}

Development

  • Install all packages

pnpm i

  • Project structure

/apps/storybook contains the web ui and configuration for Storybook.

/packages/react/ contains the code for our custom React components. Add new React components here.

/packages/css/ contains styling for the custom React components. Add styling files here. Remember to add container queries for small screens.

You need to manually add the new component to the index.ts file as an export. And you need to manually add the css file to the index.css file as an export.

Design tokens

See TOKENS.md for how to update design-tokens.

About

Gnist - Arbeidstilsynets designsystem, basert på designsystemet.no

Topics

Resources

License

Stars

Watchers

Forks

Contributors