Skip to content

Commit 425a9d1

Browse files
Copilotmfranzke
andauthored
docs: clarify foundations vs components package relationship (#4802)
* Initial plan * docs: clarify foundations vs components relationship Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> * Apply suggestions from code review --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
1 parent a7b05c5 commit 425a9d1

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,27 @@ designers, and content authors build, maintain, and scale best-of-class digital
3232
| [@db-ux/v-core-components](https://github.com/db-ux-design-system/core-web/tree/main/output/vue) | Native Vue 3 components | [![@db-ux/v-core-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ux-design-system%2Fcore-web%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ux/v-core-components "DB UX Design System – on NPM") |
3333
| [@db-ux/wc-core-components](https://github.com/db-ux-design-system/core-web/tree/main/output/stencil) | Web Components | [![@db-ux/wc-core-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ux-design-system%2Fcore-web%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ux/wc-core-components "DB UX Design System – on NPM") |
3434

35+
### Which package should I choose?
36+
37+
**For JavaScript framework-specific components**: Choose your framework package (React, Angular, Vue, Web Components) which includes styling and JavaScript behavior.
38+
39+
**For other users**: Use `@db-ux/core-components` - it includes everything you need (foundations + component styles).
40+
41+
**For design tokens only**: Use `@db-ux/core-foundations` if you only need colors, spacing, fonts, and icons without pre-built component styles.
42+
3543
## How to use
3644

37-
Install your preferred package via npm or yarn e.g. `npm i @db-ux/react-core-components`.
45+
1. **Install your preferred package** via npm or yarn:
46+
- For React: `npm i @db-ux/react-core-components`
47+
- For Angular: `npm i @db-ux/ngx-core-components`
48+
- For Vue: `npm i @db-ux/v-core-components`
49+
- For Web Components: `npm i @db-ux/wc-core-components`
50+
- For styling only: `npm i @db-ux/core-components`
51+
52+
2. **Include the CSS styles** as described in the "Styling Dependencies" section of each package's `README`.
53+
54+
> **💡 Note**: All framework packages automatically include the necessary foundation styles - you don't need to install `@db-ux/core-foundations` separately!
3855
39-
Afterwards, you need to include the specific CSS or SCSS files to apply the styles of DB UX Design System (Version 3), as described in the "Styling Dependencies" section of each package's `README`.
4056
We even provide some [examples of integrations](https://github.com/db-ux-design-system/examples).
4157

4258
### DB Theme

packages/components/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ For additional information besides the frameworks see our [Getting started](http
2323

2424
If you just need the styling follow this:
2525

26+
## Package Relationship
27+
28+
**✅ Do I need foundations if I install components?**
29+
30+
**No!** The `@db-ux/core-components` package **automatically includes** all the foundations (`@db-ux/core-foundations`) you need. You only need to install one package:
31+
32+
- **Use `@db-ux/core-components`** - If you want to use UI components (buttons, inputs, etc.)
33+
- **Use `@db-ux/core-foundations`** - If you only need design tokens, colors, spacing, fonts, and assets without any component styles
34+
2635
## Install
2736

2837
`npm i @db-ux/core-components`
2938

39+
> **Note**: This automatically includes `@db-ux/core-foundations` as a dependency, so you don't need to install it separately.
40+
3041
## Styling Dependencies
3142

3243
Import the styles in `scss` or `css`. Based on your technology the file names could be different.
@@ -35,7 +46,7 @@ Import the styles in `scss` or `css`. Based on your technology the file names co
3546
- `webpack`: asset path point to `~@db-ux/core-foundations/assets`
3647
- `rollup`: asset path point to `@db-ux/core-foundations/assets`
3748

38-
They are bundling all dependencies from [foundations](https://www.npmjs.com/package/@db-ux/core-foundations) and all [components](https://github.com/db-ux-design-system/core-web/blob/main/packages/components/src/styles/db-ux-components.scss) available.
49+
**Important**: These bundled files automatically include **all dependencies from [foundations](https://www.npmjs.com/package/@db-ux/core-foundations)** (design tokens, colors, fonts, etc.) **and all [components](https://github.com/db-ux-design-system/core-web/blob/main/packages/components/src/styles/db-ux-components.scss)** - everything you need in one import!
3950

4051
**SCSS**
4152

packages/foundations/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77

88
A library containing all tokens (colors, spacings, font formatting, etc.) and assets (icons) of [DB UX Design System v3](https://github.com/db-ux-design-system/core-web).
99

10+
## When to use this package
11+
12+
**⚠️ Looking for UI components?** You probably want [`@db-ux/core-components`](https://www.npmjs.com/package/@db-ux/core-components) instead, which **automatically includes** this package.
13+
14+
**Use this package when you:**
15+
- Only need design tokens (colors, spacing, fonts) without any component styles
16+
- Want to build custom components using the design system tokens
17+
- Need just icons and fonts without pre-built components
18+
19+
**Use [`@db-ux/core-components`](https://www.npmjs.com/package/@db-ux/core-components) when you:**
20+
- Want to use ready-made UI components (buttons, inputs, navigation, etc.)
21+
- Need both design tokens AND component styles (most common use case)
22+
1023
We currently support:
1124

1225
- [CSS](https://design-system.deutschebahn.com/core-web/review/main/foundations/readme?current=css)

0 commit comments

Comments
 (0)