- 064c5fb: Fixes for new eslint config
-
33608e2: Disallows direct use of Emotion's
css
prop on Source components.If you need to override the internal styling of Source components, use
cssOverrides
instead.
- 80eea1d: Small refactors to allow Eslint updates
-
238dfd3: Removes deprecated typography API.
In
@guardian/[email protected]
(2024-04-07), we added new web typography presets to standardise on the typographic language used by Design, and deprecated the old typography API.This release removes that old API, in order to simplify the ongoing maintenance of the library.
The following exports have been removed:
titlepiece
headline
body
textSans
titlepieceSizes
headlineSizes
bodySizes
textSansSizes
remTitlepieceSizes
remHeadlineSizes
remBodySizes
remTextSansSizes
fonts
fontWeights
lineHeights
bodyObjectStyles
headlineObjectStyles
textSansObjectStyles
titlepieceObjectStyles
along with the following
type
exports:ScaleUnit
Category
LineHeight
FontWeight
FontStyle
FontWeightDefinition
Option
TypographySizes
TypographyStyles
TitlepieceSizes
HeadlineSizes
BodySizes
TextSansSizes
Fs
FontScaleFunction
FontScaleFunctionStr
FontScaleArgs
If you cannot map existing uses of the old API to the new presets, please check which preset you should use with a designer.
-
447e6b6: Applies consistent spacing around checkboxes and radio buttons by removing conditional styles and using padding to ensure minimum height of 44px.
The external padding is now consistent regardless of the presence of a label and / or supporting text, and removes any inconsistency when these elements are stacked vertically.
Checkboxes and radio buttons are also now aligned with the first line of text when labels wrap on to multiple lines.
-
7805d16: Brings
remSize
,remIconSize
,remHeight
andremWidth
into line withremSpace
, by changing their values from anumber
(of rems) to astring
that ends withrem
units.pxToRem
also now returns a string withrem
units, rather than anumber
of rems.The sizes haven't changed, only the way they are exported.
const style = ` top: ${pxToRem(10)}rem; bottom: ${remHeight.ctaSmall}rem; `;
const style = ` top: ${pxToRem(10)}; bottom: ${remHeight.ctaSmall}; `;
If you have been performing calculations with the old number values in JS, you can use the CSS
calc
function instead:const style = ` bottom: -${remHeight.ctaSmall / 2}rem; `;
const style = ` bottom: calc(-${remHeight.ctaSmall} / 2); `;
-
69ecc3f: Moves design tokens into
@guardian/source
itself.Allows us to calculate
@guardian/source/foundations
values during build, rather than at the point of consumption, which relieves user's devices of this overhead and means the design tokens JSON will no longer be included in consumer's bundles.
- 11c62af: Adds
headlineBold15
,headlineLight15
,headlineLightItalic15
,headlineMedium15
andheadlineMediumItalic15
to the typography presets
-
d274436: Adds new icons to the icon library and applies updates to existing icons. In addition, some icons have been renamed and others deprecated. Icons that were previously deprecated have now been removed in this update.
These icons have been renamed:
Old name New name SvgBookMark
SvgBookmarkFilled
SvgBookMarkCross
SvgBookmarkCross
SvgCrossRound
SvgCrossRoundFilled
SvgHouse
SvgHomeHouseFilled
SvgPersonRound
SvgPersonRoundFilled
SvgShare
SvgShareWeb
These existing deprecated aliases have been removed:
Removed Aliased to SvgOfflineCloud
SvgCrossedOutCloud
SvgAlert
SvgExclamation
SvgMessenger
SvgFacebookMessenger
SvgInfo
SvgInfoRound
SvgPlay
SvgMediaControlsPlay
SvgPayPal
SvgPayPalBrand
eg. if you are importing
SvgOfflineCloud
this is aliased toSvgCrossedOutCloud
. The alias has now been removed so you should importSvgCrossedOutCloud
directly.The following icons have been deprecated and are still available, but will be removed in a future release:
Don't use Use instead SvgAlertTriangle
SvgAlertRound
SvgFilter
SvgFilterOutlinedWeb
SvgShareCallout
SvgShareWeb
- e5b15dc: Update TypeScript support to
v5.5.2
.
-
dc79048: Adds Guardian Headline 64px typography presets and removes Guardian Headline 70px presets.
headlineBold64 headlineLight64 headlineLightItalic64 headlineMedium64 headlineMediumItalic64
-
490384d: Now has a peer dependency of
@emotion/react@^11.11.3
(from^11.11.1
).Fixes conflicting types between Emotion's deps, as outlined in emotion-js/emotion#3141.
-
a275431: Removes
SvgSpinner
from icon library and replaces with dedicatedSpinner
component. Thesize
prop supports the existing set of named icon sizes for backwards compatibility, but also allows setting a custom size in pixels. The default colour scheme can be overridden with thetheme
prop.<> <Spinner size="small" /> <Spinner size={40} /> <Spinner theme={{ background: 'transparent', color: 'currentColor' }} /> </>
- 803f111: Adds
success.300
to the colour palette
- 637d127:
- Adds
collapseUntil
option toInline
layout component to allow collapsing into a single column below a given breakpoint. - Text and icons are now horizontally centred within buttons. Visually this is only apparent if a button's styles have been overridden and it is stretched beyond it's natural intrinsic width. (Previously the text and icon would be pushed to the edges of the button.)
- Adds
- 1921d8c: Fixes bug where
space.0
was not applied toInline
layouts and updatesColumn
andStack
to support all spacing units
- 957cbac: call react hook useId before conditional
- 522b68e: Replaced internal uses of
generateSourceId
with React'suseId
, as it does not change when the component is re-rendered. - 2e48c80: Make
react
and@emotion/react
optionalpeerDeps
(you don't need them if you're not using react components).
- be759ac: Improve README
- e60f79e: third attempt
Combining @guardian/[email protected]
and @guardian/[email protected]
into single package.
import { palette } from '@guardian/source-foundations'
import { Button } from '@guardian/source-react-components'
import { palette } from '@guardian/source/foundations'
import { Button } from '@guardian/source/react-components'
There will be no more updates to the two separate packages. From now on, all updates to Source will come via this single package.