Skip to content
Draft
54 changes: 41 additions & 13 deletions docs/getStarted.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,58 @@ Independently you need to add to `angular.json` a new line to assets like this:

It will copy on *npm build* the content of *core/dist* folder to *dist* folder in the angular app, that is deployed on *ng serve* and will give you access to assets like images, icons, etc. exported by DB UI Core. Don't forget to add it to any necessary configuration part included, like e.g. `projects.PROJECTNAME.architect.build.options` as well as `projects.PROJECTNAME.architect.test.options`

### Use scss files:
### Use SCSS files:

You can use the overall scss file or pick the relevant parts.
E.g. you can import the overall scss files to your `src/styles.scss` by adding the following imports based on your bundler in use.

#### Webpack based bundlers (e.g. Angular or Vue CLI)
#### Rollup based bundlers (e.g. Parcel, Vite)

For Rollup based bundlers like Vite or Parcel we're providing the following SCSS endpoint:

##### `@use` syntax

[source,scss]
----
@use "@db-ui/core/sources/css/rollup.assets-paths" as rollupAssetsPaths;
@use "@db-ui/core/sources/css/enterprise/db-ui-core" with (
$icons-path: rollupAssetsPaths.$icons-path,
$images-path: rollupAssetsPaths.$images-path,
$fonts-path: rollupAssetsPaths.$fonts-path
);
----

##### deprecated `@import` syntax

[source,scss]
----
@import "@db-ui/core/sources/css/rollup.assets-paths";
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
----


#### Webpack based bundlers (e.g. older Angular or Vue CLI versions)

[source,scss]
----
@use "@db-ui/core/sources/css/webpack.assets-paths" as webpackAssetsPaths;
@use "@db-ui/core/sources/css/enterprise/db-ui-core" with (
$icons-path: webpackAssetsPaths.$icons-path,
$images-path: webpackAssetsPaths.$images-path,
$fonts-path: webpackAssetsPaths.$fonts-path
);
----

##### deprecated `@import` syntax

[source,scss]
----
@import "@db-ui/core/sources/css/webpack.assets-paths";
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
----

#### General

Please keep in mind, that you would need to set your include path within the `angular.json` configuration file, like this:

[source,json]
Expand Down Expand Up @@ -155,17 +194,6 @@ module.exports = {
};
----

#### Rollup based bundlers (e.g. Vue with Vite)

For Rollup based bundlers like Vite or Parcel we're providing the following SCSS endpoint:

[source,scss]
----
@import "@db-ui/core/sources/css/rollup.assets-paths";
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
----


### Use css files:

If you want to use the compiled CSS directly, you can reference the css files in your index.html like this:
Expand Down
48 changes: 48 additions & 0 deletions docs/migrationGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@ As with every release you're recommended to do a visual regression testing for y

Especially the following aspects have changed through the various different releases and would need your review and probably adaptions within your code base.

== DB UI Core 4.0.0 Migration Guide

=== SASS Migration

We'd like to support the SASS feature `@use` and that for replace the deprecated `@import` feature. So you'll have to replace the `@import` declarations by `@use` within our consuming files.

Especially the following general imports would need to get replaced:

==== Webpack

The following `@import` syntax …

```scss
@import "@db-ui/core/sources/css/webpack.assets-paths";
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
```

… would need to replaced by `@use` syntax:

```scss
@use "@db-ui/core/sources/css/webpack.assets-paths" as webpackAssetsPaths;
@use "@db-ui/core/sources/css/enterprise/db-ui-core" with (
$icons-path: webpackAssetsPaths.$icons-path,
$images-path: webpackAssetsPaths.$images-path,
$fonts-path: webpackAssetsPaths.$fonts-path
);
```

==== Rollup bundler based software

The following `@import` syntax …

```scss
@import "@db-ui/core/sources/css/rollup.assets-paths";
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
```

… would need to replaced by `@use` syntax:

```scss
@use "@db-ui/core/sources/css/rollup.assets-paths" as rollupAssetsPaths;
@use "@db-ui/core/sources/css/enterprise/db-ui-core" with (
$icons-path: rollupAssetsPaths.$icons-path,
$images-path: rollupAssetsPaths.$images-path,
$fonts-path: rollupAssetsPaths.$fonts-path
);
```

== DB UI Core 3.0.0 Migration Guide

=== Chip
Expand Down
2 changes: 1 addition & 1 deletion source/_patterns/00-base/colors/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// * Attention ! Please expect that these declarations will get moved to DB UI Base sooner than later for easier consumption
@import "colors.variables";
@use "colors.variables";
2 changes: 1 addition & 1 deletion source/_patterns/00-base/colors/_colors.variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// * Marketingportal brand colors

@import "@db-ui/base/build/scss/variables";
@use "@db-ui/base/build/scss/variables";
49 changes: 25 additions & 24 deletions source/_patterns/00-base/colors/enterprise/_colors.variables.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// DB colors
@import "../colors.variables";
@use "../colors.variables";
@use "@db-ui/base/build/scss/variables";

// EDS semantic colors (TODO: probably leftovers, those would most likely need to get replaced again as soon as the Enterprise extension is finalized)

$DBdarkgray: $db-color-cool-gray-500; // DB Dunkelgrau/DB dark gray
$DBblue: $db-color-cyan-600; // DB Blau/DB blue
$DBwhitegray: $db-color-cool-gray-200; // DB Weißgrau/DB white-gray
$DBlightgray: $db-color-cool-gray-300; // DB light-gray
$DBgray: $db-color-cool-gray-400; // DB gray
$DBdarkgray: variables.$db-color-cool-gray-500; // DB Dunkelgrau/DB dark gray
$DBblue: variables.$db-color-cyan-600; // DB Blau/DB blue
$DBwhitegray: variables.$db-color-cool-gray-200; // DB Weißgrau/DB white-gray
$DBlightgray: variables.$db-color-cool-gray-300; // DB light-gray
$DBgray: variables.$db-color-cool-gray-400; // DB gray

// * General
$black: $db-color-cool-gray-800;
$black-bis: $db-color-cool-gray-700;
$black-ter: $db-color-cool-gray-600;
$black: variables.$db-color-cool-gray-800;
$black-bis: variables.$db-color-cool-gray-700;
$black-ter: variables.$db-color-cool-gray-600;

$gray-darker: $db-color-cool-gray-600;
$gray-darker: variables.$db-color-cool-gray-600;
$gray-dark: $DBdarkgray;
$gray: $DBgray;
$gray-light: $DBlightgray;
Expand All @@ -24,32 +25,32 @@ $gray-lighter: $DBwhitegray;
// $white-bis:
// $white:

$orange: $db-color-yellow-900;
$orange: variables.$db-color-yellow-900;
// $yellow:
$green: $db-color-green-600;
$green: variables.$db-color-green-600;
// $turquoise:
// $cyan:
$blue: $db-color-cyan-600;
$blue: variables.$db-color-cyan-600;
// $purple:
$red: $db-color-red;
$red: variables.$db-color-red;
$red-invert: #fff;

// * Enterprise Design System

// Enterprise Design System Colors
$Text: $db-color-cool-gray-800; // Text
$Background: $db-color-cool-gray-700; // Background, buttons
$Buttons: $db-color-cool-gray-700; // Background, buttons
$Icons: $db-color-cool-gray-600; // Icons, divider
$divider01: $db-color-cool-gray-700; // Icons, divider
$Text: variables.$db-color-cool-gray-800; // Text
$Background: variables.$db-color-cool-gray-700; // Background, buttons
$Buttons: variables.$db-color-cool-gray-700; // Background, buttons
$Icons: variables.$db-color-cool-gray-600; // Icons, divider
$divider01: variables.$db-color-cool-gray-700; // Icons, divider
$inputfields: $DBdarkgray; // Input fields
$selected: $db-color-cool-gray-400; // selected -> to be changed
$divider02: $db-color-cool-gray-200; // Divider
$hover: $db-color-cool-gray-200; // hover -> to be changed
$selected: variables.$db-color-cool-gray-400; // selected -> to be changed
$divider02: variables.$db-color-cool-gray-200; // Divider
$hover: variables.$db-color-cool-gray-200; // hover -> to be changed
$LightBG: #fdfdfd; // Background
$highlight-color01: $db-color-red; // Highlight color
$highlight-color01: variables.$db-color-red; // Highlight color
$highlight-color02: $blue; // Highlight color
$hover-buttons: $db-color-red-600; // hover Buttons
$hover-buttons: variables.$db-color-red-600; // hover Buttons

// Semantic color codes
// * light background
Expand Down
4 changes: 2 additions & 2 deletions source/_patterns/00-base/colors/enterprise/colors.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import "colors.variables";
@import "../colors";
@use "colors.variables";
@use "../colors" as colors2;
14 changes: 7 additions & 7 deletions source/_patterns/00-base/icons/_icons.custom-properties.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "icons.variables";
@use "icons.variables";

// TODO: The following construct was especially meant to enable a branch (EDS & FV) specific result - probably we could refactor this the sooner the later
[data-icon]:not([data-icon-variant]),
Expand All @@ -15,18 +15,18 @@
}

// DB UX Icons
@each $icon-style, $icon-sizes in $icon-font-families-personenverkehr {
@each $icon-style, $icon-sizes in icons.$icon-font-families-personenverkehr {
@each $icon-size, $icon-categories in $icon-sizes {
[data-icon-variant="#{$icon-size}-#{$icon-style}"],
[data-icon-variant-before="#{$icon-size}-#{$icon-style}"] {
[data-icon-variant="#{icons.$icon-size}-#{icons.$icon-style}"],
[data-icon-variant-before="#{icons.$icon-size}-#{icons.$icon-style}"] {
&[data-icon],
&[data-icon-before] {
@include iconMeta($icon-size, $icon-style);
@include iconMeta(icons.$icon-size, icons.$icon-style);
}
}
[data-icon-variant-after="#{$icon-size}-#{$icon-style}"] {
[data-icon-variant-after="#{icons.$icon-size}-#{icons.$icon-style}"] {
&[data-icon-after] {
@include iconMeta($icon-size, $icon-style, "after");
@include iconMeta(icons.$icon-size, icons.$icon-style, "after");
}
}
}
Expand Down
17 changes: 9 additions & 8 deletions source/_patterns/00-base/icons/_icons.font-faces.scss
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
@use "sass:string";
@import "../../../css/db-ui-core.variables";
@use "../../../css/db-ui-core.variables";

@import "icons.variables";
@use "icons.variables";

// Potential TODO: usage of the standard filenames described by https://marketingportal.extranet.deutschebahn.com/marketingportal/Basiselemente/Icons/Funktionale-Icons-Architektur-und-Fahrzeuge

@font-face {
font-display: block;
font-family: "missing-icons";
src:
url("#{$icons-path}functional/fonts/icons-empty.woff2?4r2098")
url("#{db-ui-core.$icons-path}functional/fonts/icons-empty.woff2?4r2098")
format("woff2"),
url("#{$icons-path}functional/fonts/icons-empty.woff?4r2098")
url("#{db-ui-core.$icons-path}functional/fonts/icons-empty.woff?4r2098")
format("woff");
}

// DB UX Icons
@each $icon-style, $icon-sizes in $icon-font-families-personenverkehr {
@each $icon-style, $icon-sizes in icons.$icon-font-families-personenverkehr {
@each $icon-size, $icon-categories in $icon-sizes {
@each $icon-category, $icon-font-unicodes in $icon-categories {
@font-face {
$icon-font-family: "icons-" + $icon-size + "-" + $icon-style;
$icon-font-family: "icons-" + icons.$icon-size + "-" +
icons.$icon-style;

font-display: block;

font-family: $icon-font-family;
font-style: normal;
font-weight: normal;
src:
url("#{$icons-path}functional/fonts/#{$icon-font-family+ "-" + $icon-category}.woff2?4r2098")
url("#{db-ui-core.$icons-path}functional/fonts/#{$icon-font-family+ "-" + $icon-category}.woff2?4r2098")
format("woff2"),
url("#{$icons-path}functional/fonts/#{$icon-font-family+ "-" + $icon-category}.woff?4r2098")
url("#{db-ui-core.$icons-path}functional/fonts/#{$icon-font-family+ "-" + $icon-category}.woff?4r2098")
format("woff");

unicode-range: string.unquote($icon-font-unicodes);
Expand Down
4 changes: 2 additions & 2 deletions source/_patterns/00-base/icons/_icons.variables.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@import "../../../css/helpers/functions";
@use "../../../css/helpers/functions";

// Default parameters
$icon-size: 24 !default;
$icon-style: "outline" !default;
$icons-font-family: '#{"icons-" + $icon-size + "-" + $icon-style}, "missing-icons"' !default;
$icon-content-space: to-rem(
$icon-content-space: functions.to-rem(
$pxValue: 6
) !default;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "sass:map";
@import "../../../../css/helpers/functions";
@import "../icons.variables";
@use "../../../../css/helpers/functions";
@use "../icons.variables";

// Icon font files
$icon-font-families: (
Expand Down Expand Up @@ -82,4 +82,7 @@ $icon-glyphs-enterprise: (
// "upload-cloud": "\e923",
// "watch": "\1f552"
);
$icon-glyphs: map.merge($icon-glyphs-enterprise, $icon-glyphs-personenverkehr);
icons.$icon-glyphs: map.merge(
$icon-glyphs-enterprise,
icons.$icon-glyphs-personenverkehr
);
8 changes: 4 additions & 4 deletions source/_patterns/00-base/icons/enterprise/icons.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "icons.variables";
@use "icons.variables";

@import "icons.custom-properties";
@import "icons.font-faces";
@import "../icons";
@use "icons.custom-properties" as icons2;
@use "icons.font-faces" as icons3;
@use "../icons" as icons4;
Loading