Skip to content

Commit

Permalink
feat: import the properties separately
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Jan 3, 2019
1 parent 2a6a961 commit b79e2ff
Show file tree
Hide file tree
Showing 25 changed files with 397 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ You could also set this class on the document body.

### The Reason

The benefits of explicitly defining the style class `dnb-style`, is that we could use the components by their own, without effecting all the existing styled core tags. This gives use a kind of backwards compatibility.
The benefits of explicitly defining the style class `dnb-style`, is that we then can use the components by their own, without effecting all the existing styled browser elements and tags. This gives use a kind of backwards compatibility.
But it makes it also more flexible, like if we only want to apply our DNB style to a certain area of our web application.

## For Node based environments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export default class SidebarLayout extends PureComponent {
{({ isOpen, isClosing }) => (
<Sidebar
className={classnames(
'dnb-style-selection',
isOpen && 'show-mobile-menu',
isClosing && 'hide-mobile-menu'
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default class StickyMenuBar extends PureComponent {
barStyle,
hideSiebarToggleButton && hideSiebarToggleButtonStyle
]}
className="dnb-style-selection"
>
{this.state.showOverlayMenu && (
<MainMenu
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/scripts/prepub/tasks/makeLibStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default () =>
log.text = '> PrePublish: converting sass to css'

try {
await runFactory('./src/components/**/style/dnb-*.scss')
await runFactory('./src/components/**/style/**/dnb-*.scss')
await runFactory('./src/patterns/**/style/dnb-*.scss')
log.succeed(
`> PrePublish: "makeLibStyles" converting sass to css done`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,35 @@ exports[`Button scss have to match snapshot 1`] = `
* DNB Button
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down Expand Up @@ -399,6 +428,7 @@ exports[`Button scss have to match snapshot 1`] = `
padding-right: 1.5em;
width: auto; }
.dnb-button--has-text .dnb-button__icon {
margin: 0 0.5rem;
margin: 0 calc(var(--button-icon-size) / 2); }
.dnb-button--has-text.dnb-button--icon-position-left {
padding-left: 0.5em; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
width: auto;
}
&--has-text &__icon {
margin: 0 0.5rem;
margin: 0 calc(var(--button-icon-size) / 2);
}
// &--has-text#{&}--size-large &__icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* ======================================================================== */

@import '../../../../style/component/core-imports.scss';
@import './dnb-button-theme-ui.scss';

:root {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* ======================================================================== */

@import '../../../../style/component/core-imports.scss';
@import '../_button-mixins.scss';

.dnb-button--primary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,35 @@ exports[`Dropdown scss have to match snapshot 1`] = `
* DNB Dropdown
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down Expand Up @@ -391,6 +420,7 @@ exports[`Dropdown scss have to match snapshot 1`] = `
padding-right: 1.5em;
width: auto; }
.dnb-button--has-text .dnb-button__icon {
margin: 0 0.5rem;
margin: 0 calc(var(--button-icon-size) / 2); }
.dnb-button--has-text.dnb-button--icon-position-left {
padding-left: 0.5em; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,35 @@ exports[`Icon scss have to match snapshot 1`] = `
* DNB icon
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,35 @@ exports[`InputMasked scss have to match snapshot 1`] = `
* DNB Input
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down Expand Up @@ -248,6 +277,7 @@ exports[`InputMasked scss have to match snapshot 1`] = `
padding-right: 1.5em;
width: auto; }
.dnb-button--has-text .dnb-button__icon {
margin: 0 0.5rem;
margin: 0 calc(var(--button-icon-size) / 2); }
.dnb-button--has-text.dnb-button--icon-position-left {
padding-left: 0.5em; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,35 @@ exports[`Input scss have to match snapshot 1`] = `
* DNB Input
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down Expand Up @@ -330,6 +359,7 @@ exports[`Input scss have to match snapshot 1`] = `
padding-right: 1.5em;
width: auto; }
.dnb-button--has-text .dnb-button__icon {
margin: 0 0.5rem;
margin: 0 calc(var(--button-icon-size) / 2); }
.dnb-button--has-text.dnb-button--icon-position-left {
padding-left: 0.5em; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* ======================================================================== */

@import '../../../../style/component/core-imports.scss';

.dnb-input {
color: var(--color-emerald-green);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,35 @@ exports[`Logo scss have to match snapshot 1`] = `
* DNB Logo
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,35 @@ exports[`Modal scss have to match snapshot 1`] = `
* DNB Modal
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down Expand Up @@ -615,6 +644,7 @@ exports[`Modal scss have to match snapshot 1`] = `
padding-right: 1.5em;
width: auto; }
.dnb-button--has-text .dnb-button__icon {
margin: 0 0.5rem;
margin: 0 calc(var(--button-icon-size) / 2); }
.dnb-button--has-text.dnb-button--icon-position-left {
padding-left: 0.5em; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,35 @@ exports[`Slider scss have to match snapshot 1`] = `
* DNB Slider
*
* ======================================================================== */
/*
* CSS Properties
*
* ======================================================================== */
:root {
--color-sea-green-alt: #008484;
--color-mint-green-50: #d2f0e9;
--color-mint-green-25: #e9f8f4;
--color-sea-green-4: #f5fafa;
--color-sea-green-alt-30: #b3dada;
--color-signal-yellow-30: #ffffd7;
--color-cherry-red: #e10076;
--color-cherry-red-80: #fdebf4;
--color-black: #000;
--color-black-80: #333;
--color-black-30: #b3b3b3;
--color-white: #fff;
--color-black-border: #ebebeb;
--color-sea-green: #007272;
--color-mint-green: #a5e1d2;
--color-summer-green: #28b482;
--color-emerald-green: #14555a;
--color-ocean-green: #00343e;
--color-signal-orange: #ff5400;
--color-signal-yellow: #ffff7a;
--color-indigo: #23195a;
--color-violet: #6e2382;
--color-sky-blue: #4bbed2; }
/*
* Utilities
* ========================================================================== */
Expand Down
Loading

0 comments on commit b79e2ff

Please sign in to comment.