JSPM

@times-components/styleguide

3.38.40
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q77300F
  • License BSD-3-Clause

Centralised library for common styles throughout the Times

Package Exports

  • @times-components/styleguide
  • @times-components/styleguide/dist/styleguide.js
  • @times-components/styleguide/rnw
  • @times-components/styleguide/rnw.js

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 (@times-components/styleguide) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Styleguide

The styleguide package contains the shared styles and functionalities which are commonly used across Times Components packages and components. Many of the properties of the styleguide can be simply exported as named exports:

import { colours, spacing } from "@times-components/styleguide";

However, the default export is a factory method which takes a configuration object.

Configuration

The styleguide default method can be called much like a factory funtion with a config object. This object includes a scale property which manages the user-controlled font size settings:

import styleguide from "@times-components/styleguide";

const { colours, fontFactory, spacing } = styleguide({ scale });

Animations

A cross-device component called FadeIn which animates a fade in

Colours

Exports functional or section based colours.

Fonts

Times Components fonts and font sizes.

Font factory

The fontFactory method takes a font and fontSize, and returns an object containing the appropriate font style properties, including a lineHeight.

Line heights

Times Componets line heights. This is utilised as part of the font factory scaling.

Spacing

Provides a way to standardise layout, particularly in regards to the concept of a consistent spacing layout across multiple breakpoints.

Contributing

Please read CONTRIBUTING.md before contributing to this package

Running the code

Please see our main README.md to get the project running locally

Development

The code can be formatted and linted in accordance with the agreed standards.

yarn fmt
yarn lint

Testing

This package uses yarn (latest) to run unit tests on each platform with jest.

yarn test:web

Visit the official storybook to see our available styleguide templates.