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

@amsterdam/design-system-css

v0.13.1

Published

Stylesheets for all components from the Amsterdam Design System and some general utilities. Use it to apply the visual design of the City of Amsterdam to your HTML elements or non-React components.

Downloads

3,562

Readme

Amsterdam Design System: CSS components

This package provides stylesheets for all components in the Amsterdam Design System and some general utilities. Use it to apply the visual design of the City of Amsterdam to your HTML elements or non-React components.

Introduction

We publish our components’ stylesheets as a separate package to help replicating them in other libraries, platforms, or Saas-applications. The classes are a contract between the component’s definition and its implementations and they facilitate ongoing upgrades.

Our React components use these classes in the HTML they render. You should use that package if your application uses React.

Installation

The stylesheets reference our design tokens. Both packages need to be installed.

npm install @amsterdam/design-system-css @amsterdam/design-system-tokens

Usage

The set of classes for a component can be seen as a blueprint for its markup and features. An .ams-component root selector applies the essential styles of the component to its element, and additional classes like .ams-component--variant modify its appearance or behaviour.

The classes employ the naming convention of NL Design System. Other communities only need to overwrite design tokens to use our components with their branding.

In JavaScript

Import the main stylesheet and use the class names in your markup.

import "@amsterdam/design-system-assets/font/index.css"
import "@amsterdam/design-system-css/dist/index.css"
import "@amsterdam/design-system-tokens/dist/index.css"

export const App = () => (
  <p className="ams-paragraph">Hello, world!</p>
)

In HTML

Although it is not a typical use case, the stylesheet can be included in an HTML page directly.

<!doctype html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="node_modules/@amsterdam/design-system-assets/font/index.css" />
    <link rel="stylesheet" href="node_modules/@amsterdam/design-system-css/dist/index.css" />
    <link rel="stylesheet" href="node_modules/@amsterdam/design-system-tokens/dist/index.css" />
  </head>
  <body class="ams-body">
    <p class="ams-paragraph">Hello, world!</p>
  </body>
</html>

Compact mode

Load the compact tokens to use the compact appearance of the design system, e.g. for applications. They override the spacious ones; the stylesheets can remain unchanged.

Global styles

Some elements of your document are out of reach for the Design System components. However, their styles can influence the appearance of the components.

Keep the base font size

Do not change the base font-size – e.g. through html { font-size: 62.5% }. Out typography system expects 1rem to be the browser default of 16 pixels.

If you can’t easily remove such an approach from your application, adopt the Design System components gradually by setting font-size: 100% on elements that use them.

Remove the body margin

If you haven’t removed the margin on the <body> element that browsers set by default, you can add our ams-body class to it to do so.

Use extra bold text

We only use the regular and extra bold weights of our font, Amsterdam Sans. Apply font-weight: var(--ams-text-font-weight-bold) to elements that display bold text like b, strong, and dt.

Updating

We follow semantic versioning and publish a change log to guide you through updates. The classes are a public API of the design system. Note that detecting changed or deleted classes is still a manual process.

Support

Contact us if you have a question, find an issue, or want to contribute. Find ways to reach us on designsystem.amsterdam.