Skip to content

Commit

Permalink
fix: set IE11 support for all css outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Jan 15, 2019
1 parent 3fabaaf commit 3e870bd
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 111 deletions.
4 changes: 3 additions & 1 deletion packages/dnb-design-system-portal/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ if (process.env.NODE_ENV === 'development') {
} else {
// As the gatsby-plugin-postcss plugin dont processes the scss file in the package "dnb-ui-lib" - we have to use the preprocessed version
// import both all components, patterns and the default theme
require('dnb-ui-lib/style/lib-IE11')
// require('dnb-ui-lib/style/lib-IE11')
require('dnb-ui-lib/style/patterns') // import ony patterns
require('dnb-ui-lib/style') // import both all components and the default theme
}

exports.disableCorePrefetching = () => false
1 change: 0 additions & 1 deletion packages/dnb-design-system-portal/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ module.exports = {
},
'gatsby-plugin-sass',
'gatsby-plugin-emotion',
// 'gatsby-plugin-postcss',
{
resolve: 'gatsby-plugin-postcss',
options: {
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/scripts/prepub/config/postcssConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = ({ IE11 = false, ...options } = {}) => {
border-radius: calc(2.5rem / 2);
border-radius: var(--button-border-radius);
*/
preserve: false,
preserve: true,
warnWhenCannotResolve: false
})
: null
Expand Down
7 changes: 2 additions & 5 deletions packages/dnb-ui-lib/scripts/prepub/tasks/makeMainStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export default async () => {
await runFactory('./src/style/**/dnb-ui-components.scss')
await runFactory('./src/style/**/dnb-ui-patterns.scss')
await runFactory('./src/style/**/dnb-ui-lib.scss')
await runFactory('./src/style/**/dnb-ui-lib-IE11.scss', {
IE11: true
})
log.succeed(
'> PrePublish: "makeMainStyle" transforming style modules done'
)
Expand Down Expand Up @@ -67,7 +64,7 @@ const transformStyleModules = () =>

export const runFactory = (
src,
{ IE11 = false, returnResult = false, importOnce = true } = {}
{ returnResult = false, importOnce = true } = {}
) =>
new Promise((resolve, reject) => {
log.start('> PrePublish: transforming main style')
Expand All @@ -84,7 +81,7 @@ export const runFactory = (
})
.pipe(stream)
.pipe(transform('utf8', transformMainStyleContent))
.pipe(postcss(postcssConfig({ IE11 })))
.pipe(postcss(postcssConfig({ IE11: true })))
.pipe(cloneSink)
.pipe(cssnano())
.pipe(rename({ suffix: '.min' }))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ exports[`Button scss have to match snapshot 1`] = `
--button-font-style: normal;
--button-width: 2.5rem;
--button-height: 2.5rem;
--button-width--medium: 2rem;
--button-height--medium: 2rem;
--button-width--small: 2rem;
--button-height--small: 2rem;
--button-width--large: 3rem;
--button-height--large: 3rem;
--button-icon-size: 1rem;
--button-border-width: 1px;
--button-border-width--hover: 3px;
--button-border-radius: calc(var(--button-height) / 2);
--button-border-radius--medium: calc(var(--button-height--medium) / 2);
--button-border-radius--small: calc(var(--button-height--small) / 2);
--button-border-radius--large: calc(var(--button-height--large) / 2); }
.dnb-button {
Expand Down Expand Up @@ -370,16 +370,16 @@ exports[`Button scss have to match snapshot 1`] = `
color: inherit;
background-color: inherit;
transform: translateY(var(--button-border-width)); }
.dnb-button--size-medium {
width: var(--button-width--medium);
height: var(--button-height--medium);
border-radius: var(--button-border-radius--medium); }
.dnb-button--has-text.dnb-button--size-medium {
.dnb-button--size-small {
width: var(--button-width--small);
height: var(--button-height--small);
border-radius: var(--button-border-radius--small); }
.dnb-button--has-text.dnb-button--size-small {
padding-left: 1em;
padding-right: 1em; }
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-small {
padding-left: 0.5em; }
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-small {
padding-right: 0.5em; }
.dnb-button--size-large {
width: var(--button-width--large);
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/src/components/button/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| `text` | _(optional)_ the content of the button. |
| `title` | _(optional)_ title of the button. Optional, but should always be included because of accessibility. |
| `variant` | _(optional)_ defines the kind of button. Possible values are `primary`, `secondary`, `tertiary` and `signal`. |
| `size` | _(optional)_ the size of the button. For now there is **medium** and **large** beside **default**. |
| `size` | _(optional)_ the size of the button. For now there is **small**, **default** and **large**. |
| `icon` | _(optional)_ name of icon to be included in the button. |
| `icon_position` | _(optional)_ position of icon inside the button. Set to `left` or `right`. Defaults to `right` if not set. |
| `icon_size` | _(optional)_ define icon width and height. Defaults to 16px |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
background-color: $background-color;
border-color: $background-color;

// @if $border-color {
// border-color: $border-color;
// } @else {
// border-color: $background-color;
// }

@include fakeBorder(
null,
0 0 0 var(--button-border-width--hover) $background-color
Expand Down
22 changes: 11 additions & 11 deletions packages/dnb-ui-lib/src/components/button/style/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
--button-font-style: normal;
--button-width: 2.5rem;
--button-height: 2.5rem;
--button-width--medium: 2rem;
--button-height--medium: 2rem;
--button-width--small: 2rem;
--button-height--small: 2rem;
--button-width--large: 3rem;
--button-height--large: 3rem;
--button-icon-size: 1rem;
--button-border-width: 1px;
--button-border-width--hover: 3px;
--button-border-radius: calc(var(--button-height) / 2);
--button-border-radius--medium: calc(var(--button-height--medium) / 2);
--button-border-radius--small: calc(var(--button-height--small) / 2);
--button-border-radius--large: calc(var(--button-height--large) / 2);
}

Expand Down Expand Up @@ -60,20 +60,20 @@
transform: translateY(var(--button-border-width));
}

// size medium
&--size-medium {
width: var(--button-width--medium);
height: var(--button-height--medium);
border-radius: var(--button-border-radius--medium);
// size small
&--size-small {
width: var(--button-width--small);
height: var(--button-height--small);
border-radius: var(--button-border-radius--small);
}
&--has-text#{&}--size-medium {
&--has-text#{&}--size-small {
padding-left: 1em;
padding-right: 1em;
}
&--has-text#{&}--icon-position-left#{&}--size-medium {
&--has-text#{&}--icon-position-left#{&}--size-small {
padding-left: 0.5em;
}
&--has-text#{&}--icon-position-right#{&}--size-medium {
&--has-text#{&}--icon-position-right#{&}--size-small {
padding-right: 0.5em;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ exports[`Dropdown scss have to match snapshot 1`] = `
--button-font-style: normal;
--button-width: 2.5rem;
--button-height: 2.5rem;
--button-width--medium: 2rem;
--button-height--medium: 2rem;
--button-width--small: 2rem;
--button-height--small: 2rem;
--button-width--large: 3rem;
--button-height--large: 3rem;
--button-icon-size: 1rem;
--button-border-width: 1px;
--button-border-width--hover: 3px;
--button-border-radius: calc(var(--button-height) / 2);
--button-border-radius--medium: calc(var(--button-height--medium) / 2);
--button-border-radius--small: calc(var(--button-height--small) / 2);
--button-border-radius--large: calc(var(--button-height--large) / 2); }
.dnb-button {
Expand Down Expand Up @@ -400,16 +400,16 @@ exports[`Dropdown scss have to match snapshot 1`] = `
color: inherit;
background-color: inherit;
transform: translateY(var(--button-border-width)); }
.dnb-button--size-medium {
width: var(--button-width--medium);
height: var(--button-height--medium);
border-radius: var(--button-border-radius--medium); }
.dnb-button--has-text.dnb-button--size-medium {
.dnb-button--size-small {
width: var(--button-width--small);
height: var(--button-height--small);
border-radius: var(--button-border-radius--small); }
.dnb-button--has-text.dnb-button--size-small {
padding-left: 1em;
padding-right: 1em; }
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-small {
padding-left: 0.5em; }
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-small {
padding-right: 0.5em; }
.dnb-button--size-large {
width: var(--button-width--large);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ exports[`InputMasked scss have to match snapshot 1`] = `
--button-font-style: normal;
--button-width: 2.5rem;
--button-height: 2.5rem;
--button-width--medium: 2rem;
--button-height--medium: 2rem;
--button-width--small: 2rem;
--button-height--small: 2rem;
--button-width--large: 3rem;
--button-height--large: 3rem;
--button-icon-size: 1rem;
--button-border-width: 1px;
--button-border-width--hover: 3px;
--button-border-radius: calc(var(--button-height) / 2);
--button-border-radius--medium: calc(var(--button-height--medium) / 2);
--button-border-radius--small: calc(var(--button-height--small) / 2);
--button-border-radius--large: calc(var(--button-height--large) / 2); }
.dnb-button {
Expand Down Expand Up @@ -257,16 +257,16 @@ exports[`InputMasked scss have to match snapshot 1`] = `
color: inherit;
background-color: inherit;
transform: translateY(var(--button-border-width)); }
.dnb-button--size-medium {
width: var(--button-width--medium);
height: var(--button-height--medium);
border-radius: var(--button-border-radius--medium); }
.dnb-button--has-text.dnb-button--size-medium {
.dnb-button--size-small {
width: var(--button-width--small);
height: var(--button-height--small);
border-radius: var(--button-border-radius--small); }
.dnb-button--has-text.dnb-button--size-small {
padding-left: 1em;
padding-right: 1em; }
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-small {
padding-left: 0.5em; }
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-small {
padding-right: 0.5em; }
.dnb-button--size-large {
width: var(--button-width--large);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ exports[`Input scss have to match snapshot 1`] = `
--button-font-style: normal;
--button-width: 2.5rem;
--button-height: 2.5rem;
--button-width--medium: 2rem;
--button-height--medium: 2rem;
--button-width--small: 2rem;
--button-height--small: 2rem;
--button-width--large: 3rem;
--button-height--large: 3rem;
--button-icon-size: 1rem;
--button-border-width: 1px;
--button-border-width--hover: 3px;
--button-border-radius: calc(var(--button-height) / 2);
--button-border-radius--medium: calc(var(--button-height--medium) / 2);
--button-border-radius--small: calc(var(--button-height--small) / 2);
--button-border-radius--large: calc(var(--button-height--large) / 2); }
.dnb-button {
Expand Down Expand Up @@ -329,16 +329,16 @@ exports[`Input scss have to match snapshot 1`] = `
color: inherit;
background-color: inherit;
transform: translateY(var(--button-border-width)); }
.dnb-button--size-medium {
width: var(--button-width--medium);
height: var(--button-height--medium);
border-radius: var(--button-border-radius--medium); }
.dnb-button--has-text.dnb-button--size-medium {
.dnb-button--size-small {
width: var(--button-width--small);
height: var(--button-height--small);
border-radius: var(--button-border-radius--small); }
.dnb-button--has-text.dnb-button--size-small {
padding-left: 1em;
padding-right: 1em; }
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-small {
padding-left: 0.5em; }
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-small {
padding-right: 0.5em; }
.dnb-button--size-large {
width: var(--button-width--large);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,15 +587,15 @@ exports[`Modal scss have to match snapshot 1`] = `
--button-font-style: normal;
--button-width: 2.5rem;
--button-height: 2.5rem;
--button-width--medium: 2rem;
--button-height--medium: 2rem;
--button-width--small: 2rem;
--button-height--small: 2rem;
--button-width--large: 3rem;
--button-height--large: 3rem;
--button-icon-size: 1rem;
--button-border-width: 1px;
--button-border-width--hover: 3px;
--button-border-radius: calc(var(--button-height) / 2);
--button-border-radius--medium: calc(var(--button-height--medium) / 2);
--button-border-radius--small: calc(var(--button-height--small) / 2);
--button-border-radius--large: calc(var(--button-height--large) / 2); }
.dnb-button {
Expand Down Expand Up @@ -626,16 +626,16 @@ exports[`Modal scss have to match snapshot 1`] = `
color: inherit;
background-color: inherit;
transform: translateY(var(--button-border-width)); }
.dnb-button--size-medium {
width: var(--button-width--medium);
height: var(--button-height--medium);
border-radius: var(--button-border-radius--medium); }
.dnb-button--has-text.dnb-button--size-medium {
.dnb-button--size-small {
width: var(--button-width--small);
height: var(--button-height--small);
border-radius: var(--button-border-radius--small); }
.dnb-button--has-text.dnb-button--size-small {
padding-left: 1em;
padding-right: 1em; }
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-left.dnb-button--size-small {
padding-left: 0.5em; }
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-medium {
.dnb-button--has-text.dnb-button--icon-position-right.dnb-button--size-small {
padding-right: 0.5em; }
.dnb-button--size-large {
width: var(--button-width--large);
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/src/style/components.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Web Style Import
* Imports only components, but no theme
*
*/

Expand Down
8 changes: 0 additions & 8 deletions packages/dnb-ui-lib/src/style/dnb-ui-lib-IE11.scss

This file was deleted.

14 changes: 1 addition & 13 deletions packages/dnb-ui-lib/src/style/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
/**
* Web Style Import
* Imports both the components and the default theme
*
*/

import './dnb-ui-components.scss'
import './themes/dnb-theme-ui.scss'

// TODO: Remove this as soon as there is no need for it
// just for testing porposes
// import './themes/dnb-theme-open-banking.scss'

/**
* Only for testing porposes
* This style should make perfectly buttons
*
*/
// import '../components/button/style/dnb-button.scss'
// import './themes/dnb-theme-ui.scss'
6 changes: 0 additions & 6 deletions packages/dnb-ui-lib/src/style/lib-IE11.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/src/style/lib.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Web Style Import
* Imports both components and patterns, but no theme
*
*/

Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/src/style/patterns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Web Style Import
* Imports only the patterns
*
*/

Expand Down
Loading

0 comments on commit 3e870bd

Please sign in to comment.