Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(icons): extracted icons mixin related files #527

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions source/_patterns/00-base/icons/_icon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is meant to get included within internal or even imported externally in case of that somebody wants to use the icon SCSS mixin
@import "icons.variables";
@import "icons.helpers";
@import "icons.placeholder";
2 changes: 2 additions & 0 deletions source/_patterns/00-base/icons/_icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ All of the available glyphs variables are shown on this page right next to the i

#### SCSS (recommended)

If you're only using our SCSS files incrementally and not including the `@db-ui/core/sources/css/enterprise/db-ui-core` at the beginning of your code, you would need to import the `@db-ui/core/sources/_patterns/00-base/icons/icon` file for being able to use the `icon()` SCSS mixin, that we describe below.

##### Icon for element

Use the following SCSS mixin for setting an icon:
Expand Down
2 changes: 0 additions & 2 deletions source/_patterns/01-elements/buttons/_button.variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

// We want to set the alpha value and that for need the long form hex code
// stylelint-disable color-hex-length
Expand Down
1 change: 1 addition & 0 deletions source/_patterns/01-elements/buttons/button.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@charset "utf-8";

@import "../../00-base/icons/icon";
@import "button.variables";

.elm-button {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";
@import "../../00-base/colors/colors.variables";

$checkbox---backgroundColor: rgba(255, 255, 255, 0.1) !default;
Expand Down
1 change: 1 addition & 0 deletions source/_patterns/01-elements/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@charset "utf-8";

@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "checkbox.variables";

.elm-checkbox {
Expand Down
2 changes: 0 additions & 2 deletions source/_patterns/01-elements/link/_link.variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../00-base/icons/icons.variables";
@import "../../00-base/colors/colors.variables";
@import "../../00-base/icons/icons.helpers";

$link--disabled-opacity: 0.4 !default;
$link-reaMain--color: $db-color-cyan-600 !default;
1 change: 1 addition & 0 deletions source/_patterns/01-elements/link/link.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "link.variables";

.elm-link {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

$accordion---paddingLeft: $db-spacing-m !default;
$accordion---paddingRight: to-rem(
Expand Down
1 change: 1 addition & 0 deletions source/_patterns/02-components/accordion/accordion.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "accordion.variables";

.cmp-accordion {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "../../00-base/icons/icons.helpers";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/colors/colors.variables";

$breadcrumb-divider--icon: "chevron-right" !default;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "breadcrumb.variables";

.cmp-breadcrumb {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

$dialog-backdrop--backgroundColor: rgba(0, 0, 0, 0.9) !default;
1 change: 1 addition & 0 deletions source/_patterns/02-components/dialog/dialog.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "dialog.variables";

.cmp-dialog {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";
1 change: 1 addition & 0 deletions source/_patterns/02-components/dropdown/dropdown.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "../overflow-menu/overflow-menu";
@import "dropdown.variables";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.helpers";
@import "../../00-base/icons/icons.variables";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "language-switcher.variables";

.cmp-language-switcher {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";
1 change: 1 addition & 0 deletions source/_patterns/02-components/link-list/link-list.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "link-list.variables";

.cmp-link-list {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

$header-big-link-paddingTop: 32 * 0.0625 !default;
$header---backgroundColor: #fdfdfd !default; // TODO: This would need to get replaced by the correct (semantic) color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
// TODO: Replace magic numbers e.g. with flexbox implementations and extract variables as well for multi-brand
@import "mainnavigation.variables";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

$overflowMenu---borderRadius: 8px !default;
$overflowMenu---backgroundColor: #fff !default;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "overflow-menu.variables";

.cmp-overflow-menu {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "pagination.variables";

.cmp-pagination {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

$sidenavi-link--color: $db-color-cool-gray-200 !default;
$sidenavi-linkCurrent-hover-color: $db-color-cool-gray-600 !default;
Expand Down
1 change: 1 addition & 0 deletions source/_patterns/02-components/sidenavi/sidenavi.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "sidenavi.variables";

.cmp-sidenavi {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "../../../css/helpers/functions";
@import "../../00-base/icons/icons.variables";
@import "../../00-base/icons/icons.helpers";

$sitesearch-form-full-maxWidth: to-rem(
$pxValue: 500
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../css/partials.meta";
@import "../../00-base/icons/icon";
@import "sitesearch.variables";

.cmp-sitesearch {
Expand Down
Loading