Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ There are several great reasons behind opting for having extensions separated:
import { ... } from '@dnb/eufemia/extensions'
```

### Import extensions styles

The styles for extensions are not a part of the default styles, so you have to import them explicitly.

```js
import '@dnb/eufemia/style/themes/ui/extensions'
```

Comment on lines -28 to -35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss if this is "safe" to remove now or if we should wait until v12 🤔
Could this PR be breaking for any of our consumers who do import '@dnb/eufemia/style/themes/ui/extensions'? If so, I guess we could still keep the "export" (even though it will not to anything) with a TODO comment for remember to removing it in v12.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that might be a bit breaking 😄

## Available Extensions

<ListExtensions />
32 changes: 0 additions & 32 deletions packages/dnb-eufemia/bundlewatch.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ const cssBundles = [
path: 'build/style/themes/carnegie/carnegie-theme-elements.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/carnegie/carnegie-theme-extensions.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/carnegie/carnegie-theme-forms.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/eiendom/eiendom-theme-basis.min.css',
maxSize: '10kB',
Expand All @@ -56,14 +48,6 @@ const cssBundles = [
path: 'build/style/themes/eiendom/eiendom-theme-elements.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/eiendom/eiendom-theme-extensions.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/eiendom/eiendom-theme-forms.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/sbanken/sbanken-theme-basis.min.css',
maxSize: '10kB',
Expand All @@ -76,14 +60,6 @@ const cssBundles = [
path: 'build/style/themes/sbanken/sbanken-theme-elements.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/sbanken/sbanken-theme-extensions.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/sbanken/sbanken-theme-forms.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/ui/ui-theme-basis.min.css',
maxSize: '10kB',
Expand All @@ -96,14 +72,6 @@ const cssBundles = [
path: 'build/style/themes/ui/ui-theme-elements.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/ui/ui-theme-extensions.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/ui/ui-theme-forms.min.css',
maxSize: '10kB',
},
{
path: 'build/style/themes/ui/ui-theme-properties.min.css',
maxSize: '5kB',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ describe('style build', () => {
),
'utf-8'
)
expect(content).toContain(`.dnb-forms-`)
expect(content).not.toContain(`.dnb-forms-`)
}

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ if (isCI) {
expect(global.components[0]).toContain(
'ATTENTION: This file is auto generated'
)
expect(global.components[0]).toContain('@charset "UTF-8";')
expect(global.components[0]).not.toContain(';--')
expect(global.components[0]).not.toContain('}:root{--')

expect(global.components[1]).toContain('@charset "UTF-8";')
Comment on lines -78 to -82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, looks a bit suspicious 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was to circumvent importing empty files, since there weren't any UTF-8 characters in there when empty, but probably not the best way to solve this no 🤔

expect(global.components[1]).toContain(';--')
expect(global.components[1]).toContain('}:root{--')
})
Expand Down
43 changes: 0 additions & 43 deletions packages/dnb-eufemia/scripts/prebuild/tasks/themeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ async function runThemeFactory() {
),
...processToNamesIgnoreList,
],
customContent: ({ name }) => `@use './${name}-theme-forms.scss';`,
// output
targetFile: 'components', // ui-theme-components.scss
scssOutputPath: path.resolve(__dirname, '../../../src/style/themes'),
Expand Down Expand Up @@ -109,48 +108,6 @@ async function runThemeFactory() {
)
}
})

// extensions
await runFactory({
// input
filesToFindGlob: [
path.resolve(
__dirname,
'../../../src/extensions/**/style/themes/**/*-theme-*.scss'
),
...processToNamesIgnoreList,
].concat(['!**/forms/style/themes/*']),
// output
targetFile: 'extensions', // ui-theme-extensions.scss
scssOutputPath: path.resolve(__dirname, '../../../src/style/themes'),
}).then(() => {
if (isCLI) {
log.succeed(
'> PrePublish: "themeFactory" Created the themes files with all the components, elements, fragments and extensions'
)
}
})

// forms
await runFactory({
// input
filesToFindGlob: [
path.resolve(
__dirname,
'../../../src/extensions/forms/**/style/themes/**/*-theme-*.scss'
),
...processToNamesIgnoreList,
].concat(['!**/forms/style/themes/*']),
// output
targetFile: 'forms', // ui-theme-forms.scss
scssOutputPath: path.resolve(__dirname, '../../../src/style/themes'),
}).then(() => {
if (isCLI) {
log.succeed(
'> PrePublish: "themeFactory" Created the themes files with all the components, elements, fragments and extensions'
)
}
})
}

export async function runFactory({
Expand Down
6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/style/extensions.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ $fonts-path: '../../../../assets/fonts/dnb' !default;
* NB: The content below is auto generated by the "themeFactory".
* You may want to update it by running "yarn build" locally.
*/

@use './carnegie-theme-forms.scss';

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ $fonts-path: '../../../../assets/fonts/dnb' !default;

@use '../../../components/anchor/style/themes/dnb-anchor-theme-eiendom.scss';
@use '../../../components/button/style/themes/dnb-button-theme-eiendom.scss';
@use './eiendom-theme-forms.scss';

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ $fonts-path: '../../../../assets/fonts/dnb' !default;
* NB: The content below is auto generated by the "themeFactory".
* You may want to update it by running "yarn build" locally.
*/

@use './sbanken-theme-forms.scss';

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions packages/dnb-eufemia/src/style/themes/ui/extensions.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ $fonts-path: '../../../../assets/fonts/dnb' !default;
* NB: The content below is auto generated by the "themeFactory".
* You may want to update it by running "yarn build" locally.
*/

@use './ui-theme-forms.scss';
11 changes: 0 additions & 11 deletions packages/dnb-eufemia/src/style/themes/ui/ui-theme-extensions.scss

This file was deleted.

15 changes: 0 additions & 15 deletions packages/dnb-eufemia/src/style/themes/ui/ui-theme-forms.scss

This file was deleted.

Loading