
Security News
GitHub Actions Supply Chain Attack Puts Thousands of Projects at Risk
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
@guardian/src-foundations
Advanced tools
The Guardian's foundations are the atoms from which all our visual design is built. They are intended for use with a CSS-in-JS library such as Emotion.
The Guardian's foundations are the atoms from which all our visual design is built. They are intended for use with a CSS-in-JS library such as Emotion.
$ yarn add @guardian/src-foundations
import { background } from '@guardian/src-foundations/palette';
const backgroundColor = css`
background-color: ${background.primary};
`;
import { headline, body, textSans } from '@guardian/src-foundations/typography';
const h1 = css`
${headline.large({ fontWeight: 'bold' })};
`;
const p = css`
${body.main()};
`;
const copyright = css`
${textSans.xsmall()};
`;
import { from, until, between } from '@guardian/src-foundations/mq';
const styles = css`
padding: 0 10px;
${from.mobileLandscape} {
padding: 0 20px;
}
${between.phablet.and.desktop} {
padding: 0 32px;
}
${until.wide} {
padding: 0 40px;
}
`;
import { width, height } from '@guardian/src-foundations/size';
const checkbox = css`
width: ${width.inputXsmall}px;
height: ${height.inputXsmall}px;
`;
For elements that should not appear to sighted users, but are useful to assistive technology users.
import { visuallyHidden } from '@guardian/src-foundations/accessibility';
const label = css`
${visuallyHidden};
`;
This mixin provides a clear focus state for elements that may receive keyboard focus.
import { focusHalo } from '@guardian/src-foundations/accessibility';
const input = css`
${focusHalo};
width: 200px;
height: 44px;
`;
A function that takes the ID of an element and generates a new ID. This should be set as the
ID of an element that describes the first element. The generated ID should also be passed to
the aria-describedby
attribute on the first element.
import { descriptionId } from '@guardian/src-foundations/accessibility';
const Form = () => {
const id = 'first_name';
return (
<form>
<input id={id} type="text" aria-describedby={descriptionId(id)} />
<p class="error" id={descriptionId(id)} />
</form>
);
};
FAQs
The Guardian's foundations are the atoms from which all our visual design is built. They are intended for use with a CSS-in-JS library such as Emotion.
We found that @guardian/src-foundations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 43 open source maintainers collaborating on the project.
Did you know?
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.
Security News
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
Research
Security News
A malicious Maven package typosquatting a popular library is secretly stealing OAuth credentials on the 15th of each month, putting Java developers at risk.
Security News
Socket and Seal Security collaborate to fix a critical npm overrides bug, resolving a three-year security issue in the JavaScript ecosystem's most popular package manager.