From 014c13d52fa2d2c208aaaecd557c6317baff2727 Mon Sep 17 00:00:00 2001 From: Anna Schoderer Date: Fri, 13 Jan 2023 13:09:13 +0100 Subject: [PATCH] refactor: moved basic styles to base --- package-lock.json | 14 ++--- package.json | 2 +- source/_patterns/00-base/_init.global.scss | 31 --------- source/_patterns/00-base/_init.scss | 73 ---------------------- source/css/db-ui-core.general.scss | 1 - source/css/enterprise/db-ui-core.scss | 1 - 6 files changed, 8 insertions(+), 114 deletions(-) delete mode 100644 source/_patterns/00-base/_init.scss diff --git a/package-lock.json b/package-lock.json index 355f4669a6..91f67b46a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@csstools/normalize.css": "^12.0.0", - "@db-ui/base": "2.0.0-20-58c8a10" + "@db-ui/base": "2.0.0-21-06f1b12" }, "devDependencies": { "@babel/cli": "^7.19.3", @@ -2216,9 +2216,9 @@ } }, "node_modules/@db-ui/base": { - "version": "2.0.0-20-58c8a10", - "resolved": "https://registry.npmjs.org/@db-ui/base/-/base-2.0.0-20-58c8a10.tgz", - "integrity": "sha512-y8sCmlJeqF2/0mlaEZ3UMSdIHSz+kwQ50x4Ojq3sxZExjjn31gVMMAq6ZJa/2+ROPhsOjoK9HgF9ROhKleDZow==", + "version": "2.0.0-21-06f1b12", + "resolved": "https://registry.npmjs.org/@db-ui/base/-/base-2.0.0-21-06f1b12.tgz", + "integrity": "sha512-OkSZsnzs6F3ea226H3e/LEXfomJ0IaEQCqf/VFRZG8PkjmOwbh+N6N3cPRDD+Y1HAGO9XJ3MH1P/g93aGiVL+g==", "dependencies": { "@csstools/normalize.css": "^12.0.0" } @@ -18614,9 +18614,9 @@ "requires": {} }, "@db-ui/base": { - "version": "2.0.0-20-58c8a10", - "resolved": "https://registry.npmjs.org/@db-ui/base/-/base-2.0.0-20-58c8a10.tgz", - "integrity": "sha512-y8sCmlJeqF2/0mlaEZ3UMSdIHSz+kwQ50x4Ojq3sxZExjjn31gVMMAq6ZJa/2+ROPhsOjoK9HgF9ROhKleDZow==", + "version": "2.0.0-21-06f1b12", + "resolved": "https://registry.npmjs.org/@db-ui/base/-/base-2.0.0-21-06f1b12.tgz", + "integrity": "sha512-OkSZsnzs6F3ea226H3e/LEXfomJ0IaEQCqf/VFRZG8PkjmOwbh+N6N3cPRDD+Y1HAGO9XJ3MH1P/g93aGiVL+g==", "requires": { "@csstools/normalize.css": "^12.0.0" } diff --git a/package.json b/package.json index 7560bdd043..ee99f1101c 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "license": "Apache-2.0", "dependencies": { "@csstools/normalize.css": "^12.0.0", - "@db-ui/base": "2.0.0-20-58c8a10" + "@db-ui/base": "2.0.0-21-06f1b12" }, "devDependencies": { "@babel/cli": "^7.19.3", diff --git a/source/_patterns/00-base/_init.global.scss b/source/_patterns/00-base/_init.global.scss index 31390fd229..a66d6b5f32 100644 --- a/source/_patterns/00-base/_init.global.scss +++ b/source/_patterns/00-base/_init.global.scss @@ -1,17 +1,6 @@ @use "@db-ui/base/build/scss/variables" as *; @use "@db-ui/base/build/scss/helpers/functions" as *; -// *! this is an opionionated (especially based on "enhancing" normalize.css) version of minireset.css v0.0.4 | MIT License | github.com/jgthms/minireset.css -html, -body { - margin: 0; - padding: 0; -} - -body { - min-height: 100vh; -} - // adapted from https://github.com/jgthms/bulma/blob/0.7.5/sass/base/generic.sass html { background-color: #fdfdfd; // TODO: This would need to get replaced by the correct (semantic) color @@ -48,16 +37,6 @@ body { line-height: 1.5; } -// Inline -a { - // TODO: Move to DB UI Base - color: inherit; - - strong { - color: currentColor; - } -} - code { background-color: #f5f5f5; color: darken($db-colors-primary-enabled, 2%); @@ -74,20 +53,10 @@ hr { margin: 1.5rem 0; } -img { - height: auto; - max-width: 100%; -} - small { font-size: to-em($pxValue: 14); } -// Block -fieldset { - border: none; -} - pre { background-color: #f5f5f5; color: #282d37; diff --git a/source/_patterns/00-base/_init.scss b/source/_patterns/00-base/_init.scss deleted file mode 100644 index 88d556b9d8..0000000000 --- a/source/_patterns/00-base/_init.scss +++ /dev/null @@ -1,73 +0,0 @@ -@use "@db-ui/base/build/scss/variables" as *; - -// Box sizing -html { - box-sizing: border-box; -} - -*, -::before, -::after { - box-sizing: inherit; -} - -// Media -img, -embed, -iframe, -object, -video { - height: auto; - max-width: 100%; -} - -// Iframe -iframe { - border: 0; -} - -// * Individual styles -// Navigation lists -nav, -[role="navigation"] { - ol, - ul { - list-style: none; - - margin: 0; - padding: 0; - } -} - -// General styles (TODO: most likely move those to DB UI Base) -:root { - --db-focus-outline-offset: 1px; - --db-focus-outline-color: #0087b9; - - --db-disabled-text-opacity: 0.5; -} - -// Focus styles -:is(a, button, input, textarea, summary) { - --db-focus-outline-size: max(2px, 0.08em); - transition: outline 0.06s; - - &:focus-visible { - outline: var(--db-focus-outline-size) - var(--db-focus-outline-style, solid) - var(--db-focus-outline-color, currentColor); - outline-offset: var( - --db-focus-outline-offset, - var(--db-focus-outline-size) - ); - } -} - -// List style / https://marketingportal.extranet.deutschebahn.com/de/brandguide/typografie-1#8e0be060-c2f5-42a1-abbc-6b050845d73c~paragraph--image_link -:where(ul) { - list-style-type: "\2022"+ "   "; - - li::marker { - color: $db-colors-primary-enabled; - } -} diff --git a/source/css/db-ui-core.general.scss b/source/css/db-ui-core.general.scss index 9dd69b934b..b426b80910 100644 --- a/source/css/db-ui-core.general.scss +++ b/source/css/db-ui-core.general.scss @@ -4,4 +4,3 @@ @import "@csstools/normalize.css/normalize"; @import "db-ui-core.variables"; -@import "../_patterns/00-base/init"; diff --git a/source/css/enterprise/db-ui-core.scss b/source/css/enterprise/db-ui-core.scss index 404b11a368..8fc545e2de 100644 --- a/source/css/enterprise/db-ui-core.scss +++ b/source/css/enterprise/db-ui-core.scss @@ -22,7 +22,6 @@ $partial: false; @use "@db-ui/base/build/scss/color-placeholder" as *; @use "../../_patterns/00-base/init.global" as *; -@use "../../_patterns/00-base/init" as *; // Importing helpers @use "@db-ui/base/build/scss/helpers/functions" as *;