JSPM

  • Created
  • Published
  • Downloads 2224
  • Score
    100M100P100Q129737F
  • License Apache-2.0

A range of string constants for use in CSS, intended to help implement BBC GEL-compliant webpages and components.

Package Exports

  • @bbc/gel-foundations/breakpoints
  • @bbc/gel-foundations/dist/spacings
  • @bbc/gel-foundations/dist/typography
  • @bbc/gel-foundations/spacings
  • @bbc/gel-foundations/typography

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bbc/gel-foundations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gel-foundations · GitHub license npm version PRs Welcome

This package provides a range of string constants for use in CSS, intended to help implement BBC GEL-compliant webpages and components.

Exports

/breakpoints - GEL breakpoints, as well as typography breakpoints. These use the GEL grid sizes which can be found in the GEL Grid guidelines.
/spacings - GEL spacings and GEL Grid margins and gutters. These use the GEL grid spacing sizes which can be found in the GEL Grid guidelines.
/typography - GEL typography. These are based on the gel typography standard which can be found in the GEL guidelines. More details on how these sizes were implemented for this package are available here.

Installation

npm install @bbc/gel-foundations --save

Usage

import { GEL_GROUP_3_SCREEN_WIDTH_MIN } from '@bbc/gel-foundations/breakpoints';

import { GEL_GUTTER_ABOVE_600PX } from '@bbc/gel-foundations/spacings';

import { GEL_BREVIER } from '@bbc/gel-foundations/typography';

These values can then be used directly within CSS declarations in code:

import { css } from 'styled-components';

const SomeStyledComponent = css`
  @media (min-width: ${GEL_GROUP_3_SCREEN_WIDTH_MIN}) {
    grid-gap: ${GEL_GUTTER_ABOVE_600PX};
    ${GEL_BREVIER};
  }
`;

To allow the typography to be fully accessible and responsive, please note that you should apply a default font-size to the document root (e.g. html { font-size: 100% }).

Our typography uses em for font-size and rem for line-height. em allows modularity of components: you can change the component font-size by changing the font-size of its container. rem is relative to the document root, so we use that for line-height and spacing for a consistent look-and-feel across the document. You can read our detailed analysis of "REMs vs EMs for spacing" for more information.

Contributing

When adding a new export to this utility package the export tests also need to be updated. When removing an exisiting export from this utility package the export tests need to be updated and the package version requires a major change (EG: 1.2.1 -> 2.0.0) as this would be considered a breaking change as functionality is being removed.

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.