3.13.16 • Published 1 year ago

@defencedigital/design-tokens v3.13.16

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Design Tokens

An agnostic way to store variables such as typography, color, and spacing.

Installation

The Defence Digital Design Tokens are available as an NPM package.

// npm
npm install @defencedigital/design-tokens

// yarn
yarn add @defencedigital/design-tokens

Selectors

The reccomended way to access tokens is using the supplied selector functions.

Simply import the selector object and then destructure the selectors you want to use out of this.

import { selectors } from '@defencedigital/design-tokens'

const { color, spacing, mediaQuery } = selectors

// inside a styled-component
const StyledExample = styled.div`
  color: ${color('action', '500')};
  margin-top: ${spacing('2')};

  ${mediaQuery({ gte: 'xs', lt: 'xl', media: '' })`
    // @media and (min-width:576px) and (max-width:1400px)
    color: black;
  `}
`
SelectorAliasExample Return ValueDescription
animation0.2sAnimation timing values.
breakpoint{ breakpoint: '768px' }Raw object containing breakpoint.
mediaQuerymqSee usage example above.Tagged template literal that generates a media query string.
color#FFFFFFA color value as a hex string.
shadow0 1px 3px rgba(0, 0, 0, 0.04)Preset box-shadow values.
spacing0.5remFixed spacing value in REMs.
fontSize0.5remFixed font-size value in REMs.
zIndex6001Scoped z-index value with optional modifier.

The selectors are typed. We reccomend using the hinting in your IDE to see the signatures and available arguments for each selector. Alternatively, you can see the raw tokens here on GitHub.

Raw Tokens

It's also possible to access the raw underlying tokens.

We consider these to be implementation detail (they may change without notice), as such we recommend using selectors over raw tokens in most instances.

JavaScript

import { ColorNeutral100 } from '@defencedigital/design-tokens'

SASS

@use '@defencedigital/design-tokens' as $vars;

Questions

The Design System is maintained by a team at the Defence Digital. If you want to know more about the Defence Digital Design System, please email the Design System Team.

Documentation

The documentation website contains all the information you need to build your application using the Defence Digital Design System.

Contributing

The contributing guide resource presents information about our development process.

Changelog

If you have recently updated then read the release notes

Roadmap

The Design System Roadmap Board contains the work that has been prioritised for the next 12 months.

License

The Defence Digital Design System is licensed under the Apache License 2.0.

3.13.16

1 year ago

3.13.13

1 year ago

3.13.14

1 year ago

3.13.15

1 year ago

3.13.9

1 year ago

3.13.8

1 year ago

3.13.10

1 year ago

3.13.11

1 year ago

3.13.12

1 year ago

3.13.6

2 years ago

3.13.5

2 years ago

3.13.7

1 year ago

3.13.2

2 years ago

3.13.1

2 years ago

3.13.4

2 years ago

3.13.3

2 years ago

3.13.0

2 years ago

3.12.18

2 years ago

3.12.17

2 years ago

3.12.10

2 years ago

3.12.12

2 years ago

3.12.11

2 years ago

3.12.14

2 years ago

3.12.13

2 years ago

3.12.16

2 years ago

3.12.15

2 years ago

3.12.5

2 years ago

3.12.4

2 years ago

3.12.7

2 years ago

3.12.6

2 years ago

3.12.9

2 years ago

3.12.8

2 years ago

3.12.3

2 years ago

3.11.4

2 years ago

3.11.3

2 years ago

3.11.6

2 years ago

3.11.5

2 years ago

3.11.8

2 years ago

3.11.7

2 years ago

3.10.0

2 years ago

3.12.1

2 years ago

3.12.0

2 years ago

3.12.2

2 years ago

3.11.0

2 years ago

3.11.2

2 years ago

3.11.1

2 years ago

3.9.2

2 years ago

3.9.1

2 years ago

3.9.0

2 years ago

3.8.2

2 years ago

3.8.1

2 years ago

3.7.5

2 years ago

3.7.4

2 years ago

3.7.3

2 years ago

3.7.2

2 years ago

3.8.0

2 years ago

3.6.0

2 years ago

3.7.1

2 years ago

3.5.3

2 years ago

3.7.0

2 years ago

3.5.2

2 years ago

3.5.1

2 years ago

3.4.0

2 years ago

3.2.2

2 years ago

3.3.0

2 years ago

3.5.0

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

2.67.1

2 years ago

2.69.0

2 years ago

2.69.1

2 years ago

2.74.0

2 years ago

2.72.2

2 years ago

2.72.1

2 years ago

2.72.0

2 years ago

2.78.0

2 years ago

2.76.0

2 years ago

2.72.4

2 years ago

2.72.3

2 years ago

2.70.0

2 years ago

2.78.2

2 years ago

2.78.1

2 years ago

2.68.0

2 years ago

2.68.1

2 years ago

2.73.0

2 years ago

2.71.1

2 years ago

2.71.0

2 years ago

2.77.0

2 years ago

2.75.0

2 years ago

2.79.3

2 years ago

2.79.2

2 years ago

2.79.1

2 years ago

2.79.0

2 years ago

2.80.3

2 years ago

2.80.2

2 years ago

2.67.0

2 years ago

2.80.1

2 years ago

2.80.0

2 years ago

2.63.9

2 years ago

2.63.5

3 years ago

2.63.6

3 years ago

2.63.7

3 years ago

2.63.8

2 years ago

2.64.0

2 years ago

2.63.1

3 years ago

2.65.0

2 years ago

2.64.1

2 years ago

2.63.2

3 years ago

2.66.0

2 years ago

2.65.1

2 years ago

2.64.2

2 years ago

2.63.4

3 years ago

2.60.0

3 years ago

2.61.0

3 years ago

2.62.0

3 years ago

2.63.0

3 years ago

2.59.17

3 years ago

2.59.18

3 years ago

2.59.15

3 years ago

2.59.16

3 years ago

2.59.14

3 years ago

2.59.13

3 years ago

2.59.12

3 years ago