@knime/kds-styles 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,9 +24,20 @@ All token values are fully calculated, ensuring that no variable references rema
24
24
 
25
25
  Two sets of files are generated for light and dark mode. Subsequently, the CSS files are merged to contain all variables only once. For variables that use different color values in light and dark mode, the `light-dark()` function is employed.
26
26
 
27
+ ## Fonts
28
+
29
+ The design system uses the Roboto, Roboto Condensed and Roboto Mono fonts for typography. When using `@knime/kds-styles` as a dependency the fonts will automatically be installed, no separate dependency is needed.
30
+
27
31
  ## Usage
28
32
 
29
- _This section will be filled in later once the output and possible changes are clear._
33
+ To use the design tokens and basic CSS you can simply import the following into a central CSS of your project:
34
+
35
+ - `@import "@knime/kds-styles/kds-variables.css";`: Imports all built design tokens as CSS variables, including the colors in light and dark mode
36
+ - `@import "@knime/kds-styles/kds-legacy-theme.css";`: Imports a legacy theme, which should be used to roll out design system components and tokens into an existing project, styles are adopted so old webapps-common components and new components can be used side by side
37
+ - `@import "@knime/kds-styles/fonts.css"`: Import CSS font definitions for Roboto and Roboto Mono
38
+ - `@import "@knime/kds-styles/fonts-workflows.css"`: Import CSS font definitions for Roboto Condensed which is only used in the context of workflow editing
39
+
40
+ - `@import "@knime/kds-styles/index.css"`: Bundles all previous imports and adds basic core style rules, e.g. uses modern-normalize for browser reset. **Important:** Use only for new projects, or if conversion is already at a point where core styles can be replaced.
30
41
 
31
42
  ## Important Scripts
32
43
 
@@ -1,3 +1,7 @@
1
+ :root {
2
+ font-family: var(--kds-core-font-family-roboto), sans-serif;
3
+ }
4
+
1
5
  body {
2
6
  font: var(--kds-font-base-body-medium);
3
7
  color: var(--kds-color-text-and-icon-neutral);
@@ -7,6 +11,13 @@ a {
7
11
  color: inherit;
8
12
  }
9
13
 
14
+ pre,
15
+ code,
16
+ tt,
17
+ samp {
18
+ font-family: var(--kds-core-font-family-roboto-mono), monospace;
19
+ }
20
+
10
21
  svg {
11
22
  shape-rendering: geometricPrecision;
12
23
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Fonts for workflows.
3
+ *
4
+ * Import only the weights and styles that are required:
5
+ * Sync with dist/tokens/css/_variables.css
6
+ * Search for --kds-font- to find all font related CSS variables.
7
+ */
8
+ @import "./fonts.css";
9
+ @import "@fontsource/roboto-condensed/400";
10
+ @import "@fontsource/roboto-condensed/700";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Import only the weights and styles that are required:
3
+ * Sync with dist/tokens/css/_variables.css
4
+ * Search for --kds-font- to find all font related CSS variables.
5
+ *
6
+ * Roboto Condensed is not imported here as it's only rarely used,
7
+ * it's imported in fonts-workflows.css instead.
8
+ */
9
+ @import "@fontsource/roboto";
10
+ @import "@fontsource/roboto/400-italic";
11
+ @import "@fontsource/roboto/500";
12
+ @import "@fontsource/roboto/700";
13
+ @import "@fontsource/roboto-mono/300";
@@ -1,3 +1,4 @@
1
+ @import "./fonts";
1
2
  @import "modern-normalize/modern-normalize.css";
2
3
  @import "@knime/kds-styles/kds-variables.css";
3
4
  @import "./basics";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/kds-styles",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Package containing the design tokens and icons for the KNIME Design System",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,6 +11,9 @@
11
11
  "author": "KNIME AG, Zurich, Switzerland",
12
12
  "type": "module",
13
13
  "dependencies": {
14
+ "@fontsource/roboto": "5.2.8",
15
+ "@fontsource/roboto-condensed": "5.2.8",
16
+ "@fontsource/roboto-mono": "5.2.8",
14
17
  "modern-normalize": "3.0.1"
15
18
  },
16
19
  "devDependencies": {
@@ -29,6 +32,8 @@
29
32
  ],
30
33
  "exports": {
31
34
  "./index.css": "./dist/css/index.css",
35
+ "./fonts.css": "./dist/css/fonts.css",
36
+ "./fonts-workflows.css": "./dist/css/fonts-workflows.css",
32
37
  "./kds-variables.css": "./dist/tokens/css/_variables.css",
33
38
  "./kds-properties.css": "./dist/tokens/css/_properties.css",
34
39
  "./kds-legacy-theme.css": "./dist/tokens/css/_variables-legacy.css",