@bbc/psammead-styles
Advanced tools
Comparing version 0.4.1 to 0.5.0
# @bbc/psammead-styles Changelog | ||
<!-- prettier-ignore --> | ||
| Version | Description | | ||
|---------|-------------| | ||
| 0.5.0 | [PR#573](https://github.com/bbc/psammead/pull/573) Add functions to get font styles for different services | | ||
| 0.4.1 | [PR#547](https://github.com/bbc/psammead/pull/547) Create story for gel-foundations typographies | | ||
@@ -6,0 +8,0 @@ | 0.4.0 | [PR#548](https://github.com/bbc/psammead/pull/548) Bump the reith font version from 2.302 to 2.511 | |
{ | ||
"name": "@bbc/psammead-styles", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "A collection of string constants for use in CSS, containing non-GEL styling details that are bespoke to specific BBC services and products.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -10,2 +10,4 @@ # psammead-styles - [](https://snyk.io/test/github/bbc/psammead?targetFile=packages%2Futilities%2Fpsammead-styles%2Fpackage.json) [](https://github.com/bbc/psammead/blob/latest/LICENSE) [](https://www.npmjs.com/package/@bbc/psammead-styles) [](https://github.com/bbc/psammead/blob/latest/CONTRIBUTING.md) | ||
`/font-styles` provides functions that can be used to get font-styles for different services. If a font-style is not available all the functions will fallback to regular sans font-style of the service. | ||
## Installation | ||
@@ -19,2 +21,3 @@ | ||
<!-- prettier-ignore --> | ||
```jsx | ||
@@ -51,2 +54,17 @@ import { C_POSTBOX } from '@bbc/psammead-styles/colours'; | ||
### font-styles | ||
In case you are using embeded fonts, you need to make sure you have loaded your fonts first before using the functions. If the embeded font is not loaded, the fallback font will be applied | ||
```js | ||
import { getSansRegular } from '@bbc/psammead-styles/font-styles'; | ||
const fontStyle = getSansRegular('news'); | ||
const SomeStyledComponent = css` | ||
${fontStyle}; | ||
/* more css styles */ | ||
`; | ||
``` | ||
## Contributing | ||
@@ -53,0 +71,0 @@ |
47098
20
719
80