eds 13.6.0
Install from the command line:
Learn more about npm packages
$ npm install @chanzuckerberg/eds@13.6.0
Install via package.json:
"@chanzuckerberg/eds": "13.6.0"
About this version
Education Design System (EDS) is a repository of presentational components used to build React-based products for Chan Zuckerberg Initiative.
First install the package.
# via npm
npm install --save @chanzuckerberg/eds
# or, if using Yarn
yarn add @chanzuckerberg/eds
Import the EDS stylesheet and tokens somewhere in your app root, e.g. an init.ts
or app.ts
file:
import '@chanzuckerberg/eds/index.css';
// optionally import EDS font faces
// import '@chanzuckerberg/eds/fonts.css';
We also surface an --eds-font-size-base
property to set your base rem
font size, eg:
html {
font-size: var(--eds-font-size-base); /* Resets the default pixel-to-rem ratio */
}
The EDS Tailwind theme provides many EDS tokens and some screen sizes. Import the tailwind config into the app's tailwind config and supply the content property for use:
To take all of what EDS provides (base colors, and extended utility classes for named tokens), use the following:
const edsConfig = require('@chanzuckerberg/eds/tailwind.config');
module.exports = {
content: ['./app/**/*.{ts,tsx,jsx,js}'],
theme: edsConfig.theme,
};
This will replace the default color tokens that come with Tailwind with those defined by EDS. NOTE: this might cause regressions in your project, if you have been using the default colors from tailwind.
If you want a gentler transition to using EDS tailwind config, you can instead import just the extended values:
const edsConfig = require('@chanzuckerberg/eds/tailwind.config');
module.exports = {
content: ['./app/**/*.{ts,tsx,jsx,js}'],
theme: {
extend: {
...edsConfig.theme.extend
}
}
};
This will add in the utility classes for properties like background color bg-*
, border border-*
, and text color text-*
. These match the styles and variables defined in Figma designs.
You can spread each of the sub-objects in theme
as desired, e.g., fontSize
, fontWeight
, etc.
Refer to the tokens tailwind section for usage guidelines.
EDS also provides the tokens used in the internal styles, to use in any custom component recipes and designs. If using VSCode, you can set up the IDE to expose the token values and perform autocomplete:
- Install the CSS Var Complete VSCode extension
- Add the following setting to your user or workspace settings file
{
// ...rest of the settings here
"cssvar.files": [
"node_modules/@chanzuckerberg/eds/lib/index.css"
]
}
- Restart VSCode
Refer to the "EDS Token and Theme Tools" in the tokens documentation to learn about the optional tooling setup.
Import any of the components from the top-level package:
// Import components by name at the top of your file
import { Heading } from '@chanzuckerberg/eds';
and then use them in your React components:
<Heading variant="neutral-strong" size="h2">
Coffee!
</Heading>
EDS provides a suite of components for use, and documentation for available props and overrides.
This project is under active development. See CONTRIBUTING.md for more information on how to contribute to EDS. Also, read our guidelines for additional information.
Instead, if you want to report an issue, you can open an issue.
This project is governed under the Contributor Covenant code of conduct.
See our Security Readme.
Please review our Education Design System Site (SSO Required): /Paper
Details
- eds
- chanzuckerberg
- about 1 year ago
- MIT
- 93 dependencies
Assets
- eds-13.6.0.tgz
Download activity
- Total downloads 886
- Last 30 days 0
- Last week 0
- Today 0