Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bbc/gel-foundations

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/gel-foundations

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

  • 7.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54
increased by440%
Maintainers
2
Weekly downloads
 
Created
Source

gel-foundations - Known Vulnerabilities Dependency Status peerDependencies Status 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 type sizes and font stacks. These are based on the GEL Typography definitions which can be found in the GEL guidelines. More details on how the type 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 { getLongPrimer } 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`
  font-family: ${GEL_FF_REITH_SANS};
  ${getLongPrimer(script)};

  @media (min-width: ${GEL_GROUP_3_SCREEN_WIDTH_MIN}) {
    grid-gap: ${GEL_GUTTER_ABOVE_600PX};
  }
`;

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 rem for font-size and line-height. The rem unit represents a size relative to the document root, so we use that for font-size, 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.

Script support

The utility typography function (e.g. getLongPrimer('arabic')) receives a script argument which is an object with the different script GEL Types Sizes and returns the font-sizes and line-heights for the specific GEL Type (e.g. Long Premier).

You can import the script doing import { arabic } from '@bbc/gel-foundations/scripts. By default you should import the latin script as found on the GEL typography guidelines.

In addition to Latin script defaults, Psammead supports typography for a number of other scripts. We have grouped the scripts that share similiar features as follows:

Group NameServicesRationale
latin-and-cyrillicNews, Hausa, Gahuza, Somali, Swahili, Igbo, Pidgin, Afaan Oromo, Yoruba, Azeri, Indonesia, Uzbek, Serbian, Russian, Ukrainian, Kyrgyz, UzbekThe typography values for Latin and Cyrillic characters are identical
latin-with-diacriticsVietnamese, Mundo, Afrique, Brasil, TurkishThe diacritics make these values differ from Latin
arabicArabic, Pashto, Persian, UrduGroup as they use the Arabic alphabet
no-ascenders-or-descendersKorean, Japanese, Zhongwen, Ukchina, Tigrinya, AmharicGroup all alphabets without ascenders or descenders. This could be implemented as chinese, korean, ethiopic
devanagari-and-gurmukhiHindi, Nepali, Gujarati, Punjabi, Marathi, TeluguThe typography values for Devanagari and Gurmukhi characters are identical
thaiThaiBespoke to the Thai characters
bengaliBengaliBespoke to the Bengal characters
burmeseBurmeseBespoke to the Burmese characters
sinhaleseSinhalaBespoke to the Sinhalese characters
tamilTamilBespoke to the Tamil characters

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.

Keywords

FAQs

Package last updated on 30 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc