0.35.3 • Published 7 days ago

@amsterdam/asc-assets v0.35.3

Weekly downloads
1,289
License
MPL-2.0
Repository
github
Last release
7 days ago

asc-assets

This is a standalone package that contains:

  • Fonts (including CSS font-face definitions)
  • Icons (SVGs as React components)

Install

Add this package to your project by running:

npm install @amsterdam/asc-assets

Basic Usage

Icons

import { IconName } from '@amsterdam/asc-assets'

return <IconName />

Fonts

Note: Some of the fonts that are used in Amsterdam are licensed, before you include these fonts in your application make sure that you have obtained a licence to do so.

There are currently two ways of including the fonts used in your application, you can either copy them in from this package in your build or include a version from the Amsterdam CDN. Note that if you want to use the version hosted by Amsterdam you must have an application that runs in the amsterdam.nl domain space.

Using the Amsterdam CDN

Add the following code to your index.html file:

<!-- This script is needed as specified by the font license -->
<script src="https://static.amsterdam.nl/fonts/mtiFontTrackingCode.min.js"></script>
<link href="https://static.amsterdam.nl/fonts/fonts.css" rel="stylesheet" />

There is nothing more to do, the fonts should now be available in your application.

Copying the files at build time

This step assumes that you are using WebPack, but it should be possible to do this with other tools or a simple shell script as well.

Add the following code to your WebPack configuration:

new CopyWebpackPlugin({
  patterns: [
    {
      from: './node_modules/@amsterdam/asc-assets/static/fonts',
      to: 'fonts',
    },
  ],
})

And make sure to import the CSS file in your stylesheet:

@import '~@amsterdam/asc-assets/static/fonts/fonts.css';

Build Project

yarn build # generates JSX components using the optimized SVG icons
0.35.3

7 days ago

1.0.0-alpha.0

7 days ago

1.0.0-beta.0

7 days ago

0.35.0

6 months ago

0.34.0

7 months ago

0.33.1-alpha.45

7 months ago

0.33.0

8 months ago

0.32.0

9 months ago

0.31.0

11 months ago

0.30.1-alpha.20

11 months ago

0.30.0

11 months ago

0.29.4-alpha.18

1 year ago

0.29.4-alpha.21

1 year ago

0.29.3-alpha.43

1 year ago

0.29.3

1 year ago

0.29.1-alpha.1

1 year ago

0.29.2-alpha.0

1 year ago

0.29.0

1 year ago

0.29.2

1 year ago

0.29.1

1 year ago

0.27.1-alpha.60

1 year ago

0.28.0

1 year ago

0.27.0

1 year ago

0.27.1-alpha.0

1 year ago

0.26.3-alpha.0

1 year ago

0.26.2

1 year ago

0.26.2-alpha.0

1 year ago

0.26.1

2 years ago

0.26.0

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago

0.24.5-alpha.5

2 years ago