Giter Site home page Giter Site logo

db-ui / base Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 3.0 19.75 MB

Provides basic tokens and assets based on the DB UX Design System.

Home Page: https://db-ui.github.io/base/

License: Apache License 2.0

JavaScript 18.11% Handlebars 33.26% SCSS 18.62% CSS 30.01%
designtokens tailwindcss hacktoberfest

base's People

Contributors

dependabot[bot] avatar dkolba avatar fridokus avatar github-actions[bot] avatar mfranzke avatar nmerget avatar pschaub avatar shartte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

base's Issues

Icons: fill-rule="evenodd" is deleted on icon-fonts

All filles/solid icons with fill-rule="evenodd" works as plain svg, but the fill-role is deleted on fonts.

This results in just "black" icons.

Compare to icons check-circle and error starting with size 24.

full list of problematic, filled icons:

size 24

  • action: check-circle
  • action: help
  • action: info
  • action: remove
  • notification: error
  • notification: warning

size 32

  • action: add-circle
  • action: check-circle
  • action: help
  • action: info
  • action: remove
  • notification: error
  • notification: warning

Further information on the topic

Consolidate lintings on pre-commit

We're currently linting and prettifying our files from two to three times (lint-staged and npm run lint afterwards, whereas .js files even also get another prettifying through xo).

Tailwind Tokens: Additional gaps and space

Currently the TailwindCSS tokens are adding custom gaps and space values:

"gap": {
"xs": "8px",
"sm": "12px",
"md": "12px",
"lg": "20px",
"xl": "20px"
},
"space": {
"xs": "8px",
"sm": "12px",
"md": "12px",
"lg": "20px",
"xl": "20px"
}

Why do we set them? Why is there no 16px? Why are they duplicated? Is there any relation to the breakpoints?

Mostly you are using the default gap values (e.g. gap-1 instead of gap-md); see https://tailwindcss.com/docs/gap

Icons update

Updating icons library (functional to 2.23.0 and illustrative 2.18.0).

Illustrative

Changed

  • db_ic_il_db_trainstation_with_train.svg renamed to db_ic_il_db_train_station_with_train.svg
  • db_ic_il_db_trainstation.svg renamed to db_ic_il_db_train_station.svg

SVG Icon Issues with Fill

I am trying to make a React MUI component lib that contains all icons transpiled into React Components (which can be done at build-time, but is cumbersome).

I noticed that the original icons have been modified to include the following fill rules:
CSS variables (replace fill="#282D37" by fill="#282D37" style="fill: currentColor;fill: var(--db-icon-color, currentColor)")

Theses fill rules cause a problem with svgr:

[...] fill="#EC0016" style={{fill: "#EC0016", fill: "var(--db-icon-pulse-color, #EC0016)"}} 

Typescript will complain about "fill" being defined twice in the object literal.

I am not sure the definition even needs to be like that. The CSS fill always overwrites the fill color defined via attribute, and why is the fallback for browsers not supporting var needed? Do we really support IE11? :P
If so, we could also just write fill="currentColor" style="fill: var(--db-icon-color, currentColor)"

Changelogs: Decide on how to handle

Currently we're moving to describe the releases contents within the https://github.com/db-ui/base/releases section. In that case we would want to prevent the redundant information within the CHANGELOG.md files, but we would at least need a hint in that file that mentions and links to that releases section.
Additionally we would need to decide on the amount of information we want to provide with the releases. For the previous ones I've removed the irrelevant information regarding our optimizations, dependency updates, etc., which are mainly related to our dev platforms / under the hood changes and only included aspects that were related to the consumers of the packages, as well as choosing a summarizing title for these changes afterwards. But we need to align on this as well.

Relevant for all three repos.

Tailwind Tokens: Breakpoints are inconsistent with guidelines

Currently the breakpoints 640px, 768px, 1024px and 1280px are set as Tailwind tokens:

{
"screens": {
"sm": "640px",
"md": "768px",
"lg": "1024px",
"xl": "1280px"
}
}

The guidelines are currently showing breakpoints at 440px, 768px, 1024px and 1440px:
image
Source: https://marketingportal.extranet.deutschebahn.com/marketingportal/Design-Anwendungen/DB-UX-Design-System/Design-fuer-Apps-Web/Layout

For reference: the TailwindCSS defaults can be found here: https://github.com/tailwindlabs/tailwindcss/blob/master/stubs/config.full.js#L781-L787

CI/CD: warnings

There are two warnings regarding the CI/CD scripts:

This relates to the other repos as well.

Icons: two transport icons with incorrect artifacts

Two of the 32 size transportation icons are including an unwanted thin visual line, that we need to fix.

MicrosoftTeams-image (41)

To know what to do about it if we might face the problem in the future again, we should also document the solution.

adapt data-attributes instead of classes for settings

    I would expect `class="db-ui-regular"` to be `data-tonality="regular"` (and in the generator files accordingly), adapted by the other attributes like e.g. size (`data-size`), variant (`data-variant`), etc. This seem to have been overlooked in colors, scaling and typography as well.

Originally posted by @mfranzke in #174 (comment)

DB fonts are not used in tailwind-specific classes

If you use @db-ui/base with Tailwind CSS and you try to use font-bold the DB fonts will not be used.

Issue:
Tailwind will try to use the CSS font-family: 'DB Screen Sans Bold', Helvetica, Arial, sans-serif which contains the wrong font name DB Screen Sans Bold.

Solution:
Tailwind should use the font family DB Screen Sans instead of the wrong name DB Screen Sans Bold.

Icon fonts evals

  • Evaluate to merge the different icon styles into one font, especially as outline seems the be default and solid only a rare anomaly
    • Evaluate to use font-weight to differentiate in between the different icon styles.

generated typography-placeholder contents are incorrect

The generated build/scss/_typography-placeholder.scss files contents seem to be incorrect โ€“ where we had some selectors like the following previously:

%db-normal-headline-3xl{

	line-height: $db-typography-normal-mobile-headline-3xlarge-line-height;
	font-size: $db-typography-normal-mobile-headline-3xlarge-font-size;

    &-light,
    &[data-variant="light"] {
        font-weight: 300;
    }
	
	@media only screen and (min-width: $db-screens-md) {
		line-height: $db-typography-normal-tablet-headline-3xlarge-line-height;
		font-size: $db-typography-normal-tablet-headline-3xlarge-font-size;}

	@media only screen and (min-width: $db-screens-lg) {
		line-height: $db-typography-normal-desktop-headline-3xlarge-line-height;
		font-size: $db-typography-normal-desktop-headline-3xlarge-font-size;}
}

We now get:

%db-desktop-3xlarge-lineHeight{

	line-height: $db-typography-desktop-mobile-3xlarge-lineHeight-line-height;
	font-size: $db-typography-desktop-mobile-3xlarge-lineHeight-font-size;

	--db-base-icon-font-size: #{$db-typography-desktop-mobile-3xlarge-lineHeight-font-size};
	--db-base-icon-font-family: #{get-icon-family($db-typography-desktop-mobile-3xlarge-lineHeight-font-size,
	$db-typography-desktop-mobile-3xlarge-lineHeight-line-height)};
	--db-base-icon-font-family-filled: #{get-icon-family($db-typography-desktop-mobile-3xlarge-lineHeight-font-size,
	$db-typography-desktop-mobile-3xlarge-lineHeight-line-height,"filled")};
	--db-type-body-font-size-lineHeight: #{$db-typography-desktop-mobile-3xlarge-lineHeight-font-size};
	--db-type-body-line-height-lineHeight: #{$db-typography-desktop-mobile-3xlarge-lineHeight-line-height};
		
	@media only screen and (min-width: $db-screens-md) {
		line-height: $db-typography-desktop-tablet-3xlarge-lineHeight-line-height;
		font-size: $db-typography-desktop-tablet-3xlarge-lineHeight-font-size;
		--db-base-icon-font-size: #{$db-typography-desktop-tablet-3xlarge-lineHeight-font-size};
		--db-base-icon-font-family: #{get-icon-family($db-typography-desktop-tablet-3xlarge-lineHeight-font-size,
		$db-typography-desktop-tablet-3xlarge-lineHeight-line-height)};
		--db-base-icon-font-family-filled: #{get-icon-family($db-typography-desktop-tablet-3xlarge-lineHeight-font-size,
		$db-typography-desktop-tablet-3xlarge-lineHeight-line-height,"filled")};
		--db-type-body-font-size-lineHeight: #{$db-typography-desktop-tablet-3xlarge-lineHeight-font-size};
		--db-type-body-line-height-lineHeight: #{$db-typography-desktop-tablet-3xlarge-lineHeight-line-height};
		}

	@media only screen and (min-width: $db-screens-lg) {
		line-height: $db-typography-desktop-desktop-3xlarge-lineHeight-line-height;
		font-size: $db-typography-desktop-desktop-3xlarge-lineHeight-font-size;
		--db-base-icon-font-size: #{$db-typography-desktop-desktop-3xlarge-lineHeight-font-size};
		--db-base-icon-font-family: #{get-icon-family($db-typography-desktop-desktop-3xlarge-lineHeight-font-size,
		$db-typography-desktop-desktop-3xlarge-lineHeight-line-height)};
		--db-base-icon-font-family-filled: #{get-icon-family($db-typography-desktop-desktop-3xlarge-lineHeight-font-size,
		$db-typography-desktop-desktop-3xlarge-lineHeight-line-height,"filled")};
		--db-type-body-font-size-lineHeight: #{$db-typography-desktop-desktop-3xlarge-lineHeight-font-size};
		--db-type-body-line-height-lineHeight: #{$db-typography-desktop-desktop-3xlarge-lineHeight-line-height};
		}
}

So this is mainly about the placeholder and variable names within like e.g. $db-typography-desktop-mobile-3xlarge-lineHeight-line-height that seem to be incorrect.

GitHub Actions: Deprecated save-state and set-output commands

https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

A workflow using save-state or set-output like the following

- name: Save state
run: echo "::save-state name={name}::{value}"

- name: Set output
run: echo "::set-output name={name}::{value}"

should be updated to write to the new GITHUB_STATE and GITHUB_OUTPUT environment files:

- name: Save state
run: echo "{name}={value}" >> $GITHUB_STATE

- name: Set output
run: echo "{name}={value}" >> $GITHUB_OUTPUT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.