diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/Anchor.screenshot.test.ts b/packages/dnb-eufemia/src/components/anchor/__tests__/Anchor.screenshot.test.ts index e8ceb444cf1..70d2bfacbca 100644 --- a/packages/dnb-eufemia/src/components/anchor/__tests__/Anchor.screenshot.test.ts +++ b/packages/dnb-eufemia/src/components/anchor/__tests__/Anchor.screenshot.test.ts @@ -8,187 +8,196 @@ import { setupPageScreenshot, } from '../../../core/jest/jestSetupScreenshots' -describe.each(['ui', 'sbanken'])('Anchor for %s', (themeName) => { - setupPageScreenshot({ themeName, url: '/uilib/components/anchor' }) - - it('have to match the preview states', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-states"]', - }) - expect(screenshot).toMatchImageSnapshot() - }) - - it('have to match breaking lines', async () => { - const screenshot = await makeScreenshot({ - style: { - 'white-space': 'nowrap', - }, - selector: '[data-visual-test="anchor-newline"]', - }) - expect(screenshot).toMatchImageSnapshot() - }) - - it('have to match anchor with skeleton', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-skeleton"]', - }) - expect(screenshot).toMatchImageSnapshot() - }) - - it('have to match anchor with icon-right', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-icon-right"]', - }) - expect(screenshot).toMatchImageSnapshot() - }) +describe.each(['ui', 'sbanken', 'eiendom'])( + 'Anchor for %s', + (themeName) => { + setupPageScreenshot({ themeName, url: '/uilib/components/anchor' }) - it('have to match anchor with icon left', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-icon-left"]', + it('have to match the preview states', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-states"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match anchor with icon node', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-icon-node"]', + it('have to match breaking lines', async () => { + const screenshot = await makeScreenshot({ + style: { + 'white-space': 'nowrap', + }, + selector: '[data-visual-test="anchor-newline"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match anchor with paragraph', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-paragraph"]', - matchConfig: { - failureThreshold: 0.0013, - }, + it('have to match anchor with skeleton', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-skeleton"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match anchor in heading', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-heading"]', + it('have to match anchor with icon-right', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-icon-right"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the "default" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-default"]', + it('have to match anchor with icon left', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-icon-left"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the "focus" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-default"]', - simulateSelector: '[data-visual-test="anchor-default"] .dnb-anchor', - simulate: 'focus', + it('have to match anchor with icon node', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-icon-node"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the "hover" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-default"]', - simulateSelector: '[data-visual-test="anchor-default"] .dnb-anchor', - simulate: 'hover', + it('have to match anchor with paragraph', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-paragraph"]', + matchConfig: { + failureThreshold: 0.0013, + }, + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the "active" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-default"]', - simulateSelector: '[data-visual-test="anchor-default"] .dnb-anchor', - simulate: 'active', + it('have to match anchor in heading', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-heading"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the anchor-contrast "default" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-contrast"]', + it('have to match the "default" state', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-default"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the anchor-contrast "focus" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-contrast"]', - simulateSelector: '[data-visual-test="anchor-contrast"] .dnb-anchor', - simulate: 'focus', + it('have to match the "focus" state', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-default"]', + simulateSelector: + '[data-visual-test="anchor-default"] .dnb-anchor', + simulate: 'focus', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the anchor-contrast "hover" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-contrast"]', - simulateSelector: '[data-visual-test="anchor-contrast"] .dnb-anchor', - simulate: 'hover', + it('have to match the "hover" state', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-default"]', + simulateSelector: + '[data-visual-test="anchor-default"] .dnb-anchor', + simulate: 'hover', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the anchor-contrast "active" state', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-contrast"]', - simulateSelector: '[data-visual-test="anchor-contrast"] .dnb-anchor', - simulate: 'active', + it('have to match the "active" state', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-default"]', + simulateSelector: + '[data-visual-test="anchor-default"] .dnb-anchor', + simulate: 'active', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - it('have to match the dnb-anchor--no-underline', async () => { - const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-in-section"]', + it('have to match the anchor-contrast "default" state', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-contrast"]', + }) + expect(screenshot).toMatchImageSnapshot() }) - expect(screenshot).toMatchImageSnapshot() - }) - if (themeName === 'sbanken') { - it('have to match the dnb-anchor--inline class', async () => { + it('have to match the anchor-contrast "focus" state', async () => { const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-inline"]', + selector: '[data-visual-test="anchor-contrast"]', + simulateSelector: + '[data-visual-test="anchor-contrast"] .dnb-anchor', + simulate: 'focus', }) expect(screenshot).toMatchImageSnapshot() }) - it('have to match the dnb-anchor--inline hover', async () => { + it('have to match the anchor-contrast "hover" state', async () => { const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-inline"]', + selector: '[data-visual-test="anchor-contrast"]', simulateSelector: - '[data-visual-test="anchor-inline"] a.dnb-anchor', + '[data-visual-test="anchor-contrast"] .dnb-anchor', simulate: 'hover', }) expect(screenshot).toMatchImageSnapshot() }) - it('have to match the dnb-anchor--inline active', async () => { + it('have to match the anchor-contrast "active" state', async () => { const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-inline"]', + selector: '[data-visual-test="anchor-contrast"]', simulateSelector: - '[data-visual-test="anchor-inline"] a.dnb-anchor', + '[data-visual-test="anchor-contrast"] .dnb-anchor', simulate: 'active', }) expect(screenshot).toMatchImageSnapshot() }) - it('have to match the dnb-anchor--inline focus', async () => { + it('have to match the dnb-anchor--no-underline', async () => { const screenshot = await makeScreenshot({ - selector: '[data-visual-test="anchor-inline"]', - simulateSelector: - '[data-visual-test="anchor-inline"] a.dnb-anchor', - simulate: 'focus', + selector: '[data-visual-test="anchor-in-section"]', }) expect(screenshot).toMatchImageSnapshot() }) + + if (themeName === 'sbanken') { + it('have to match the dnb-anchor--inline class', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-inline"]', + }) + expect(screenshot).toMatchImageSnapshot() + }) + + it('have to match the dnb-anchor--inline hover', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-inline"]', + simulateSelector: + '[data-visual-test="anchor-inline"] a.dnb-anchor', + simulate: 'hover', + }) + expect(screenshot).toMatchImageSnapshot() + }) + + it('have to match the dnb-anchor--inline active', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-inline"]', + simulateSelector: + '[data-visual-test="anchor-inline"] a.dnb-anchor', + simulate: 'active', + }) + expect(screenshot).toMatchImageSnapshot() + }) + + it('have to match the dnb-anchor--inline focus', async () => { + const screenshot = await makeScreenshot({ + selector: '[data-visual-test="anchor-inline"]', + simulateSelector: + '[data-visual-test="anchor-inline"] a.dnb-anchor', + simulate: 'focus', + }) + expect(screenshot).toMatchImageSnapshot() + }) + } } -}) +) -describe.each(['ui', 'sbanken'])( +describe.each(['ui', 'sbanken', 'eiendom'])( 'Anchor target blank for %s', (themeName) => { setupPageScreenshot({ themeName, url: '/uilib/components/anchor' }) @@ -225,7 +234,7 @@ describe.each(['ui', 'sbanken'])( } ) -describe.each(['ui', 'sbanken'])( +describe.each(['ui', 'sbanken', 'eiendom'])( 'Anchor legacy icon usage for %s', (themeName) => { setupPageScreenshot({ themeName, url: '/uilib/components/anchor' }) diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-in-heading.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-in-heading.snap.png new file mode 100644 index 00000000000..29a4ad1dfcf Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-in-heading.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-left.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-left.snap.png new file mode 100644 index 00000000000..a722b76bef5 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-left.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-node.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-node.snap.png new file mode 100644 index 00000000000..cc8fc7bf57a Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-node.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-right.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-right.snap.png new file mode 100644 index 00000000000..fdb70af1f9c Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-icon-right.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-paragraph.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-paragraph.snap.png new file mode 100644 index 00000000000..554ed1ba59b Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-paragraph.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-skeleton.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-skeleton.snap.png new file mode 100644 index 00000000000..d719f196ce2 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-anchor-with-skeleton.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-breaking-lines.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-breaking-lines.snap.png new file mode 100644 index 00000000000..b78d9aaaa26 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-breaking-lines.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-active-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-active-state.snap.png new file mode 100644 index 00000000000..5116ba25500 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-active-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-active-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-active-state.snap.png new file mode 100644 index 00000000000..a2f2bfd0fea Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-active-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-default-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-default-state.snap.png new file mode 100644 index 00000000000..da0dbc810c9 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-default-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-focus-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-focus-state.snap.png new file mode 100644 index 00000000000..ac3680d0a33 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-focus-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-hover-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-hover-state.snap.png new file mode 100644 index 00000000000..d959662db3a Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-anchor-contrast-hover-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-default-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-default-state.snap.png new file mode 100644 index 00000000000..470af78be7f Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-default-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-dnb-anchor-no-underline.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-dnb-anchor-no-underline.snap.png new file mode 100644 index 00000000000..83a32e3245e Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-dnb-anchor-no-underline.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-focus-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-focus-state.snap.png new file mode 100644 index 00000000000..8c40964add1 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-focus-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-hover-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-hover-state.snap.png new file mode 100644 index 00000000000..36c86a93111 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-hover-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-preview-states.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-preview-states.snap.png new file mode 100644 index 00000000000..030a3bba832 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-for-eiendom-have-to-match-the-preview-states.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-legacy-icon.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-legacy-icon.snap.png new file mode 100644 index 00000000000..5ddb4e3df6b Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-legacy-icon.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-paragraph-legacy-icon.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-paragraph-legacy-icon.snap.png new file mode 100644 index 00000000000..05be77cc911 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-paragraph-legacy-icon.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-target-blank-legacy-icon.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-target-blank-legacy-icon.snap.png new file mode 100644 index 00000000000..b56a78b1362 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-legacy-icon-usage-for-eiendom-have-to-match-anchor-with-target-blank-legacy-icon.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-target-blank-for-eiendom-have-to-match-blank-target-anchor-in-heading.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-target-blank-for-eiendom-have-to-match-blank-target-anchor-in-heading.snap.png new file mode 100644 index 00000000000..197c10cb0ff Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-target-blank-for-eiendom-have-to-match-blank-target-anchor-in-heading.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-target-blank-for-eiendom-have-to-match-the-target-blank-state.snap.png b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-target-blank-for-eiendom-have-to-match-the-target-blank-state.snap.png new file mode 100644 index 00000000000..0c30b24e585 Binary files /dev/null and b/packages/dnb-eufemia/src/components/anchor/__tests__/__image_snapshots__/anchor-target-blank-for-eiendom-have-to-match-the-target-blank-state.snap.png differ diff --git a/packages/dnb-eufemia/src/components/anchor/__tests__/__snapshots__/Anchor.test.tsx.snap b/packages/dnb-eufemia/src/components/anchor/__tests__/__snapshots__/Anchor.test.tsx.snap index 94e81de3030..77b57821b7d 100644 --- a/packages/dnb-eufemia/src/components/anchor/__tests__/__snapshots__/Anchor.test.tsx.snap +++ b/packages/dnb-eufemia/src/components/anchor/__tests__/__snapshots__/Anchor.test.tsx.snap @@ -320,6 +320,27 @@ sup .dnb-anchor, sub .dnb-anchor { display: inline-block; transform: translateY(-0.0625em); } +.dnb-anchor.dnb-anchor--contrast { + color: var(--color-white); +} +.dnb-anchor.dnb-anchor--contrast:hover { + color: var(--anchor-color--contrast); + box-shadow: inset 100vw 100vw 0 0 var(--color-white), -0.125em 0 0 0 var(--color-white), 0.125em 0 0 0 var(--color-white); +} +.dnb-anchor.dnb-anchor--contrast:active { + color: var(--color-white); + background-color: transparent; + box-shadow: inset 100vw 100vw 0 0 transparent, -0.125em 0 0 0 transparent, 0.125em 0 0 0 transparent; +} +.dnb-anchor.dnb-anchor--contrast:focus-visible { + color: var(--color-white); + background-color: transparent; + outline: none; + --border-color: var(--color-white); + --border-width: var(--focus-ring-width); + box-shadow: 0 0 0 var(--border-width) var(--border-color); + border-color: transparent; +} .dnb-anchor--hover { border-radius: 0.25em; @@ -401,9 +422,14 @@ exports[`Anchor scss has to match theme css for sbanken 1`] = ` /* * Utilities */ +/* + * Anchor theme + * + */ .dnb-anchor { --anchor-underline-thickness: 0.125rem; --anchor-background: transparent; + --anchor-color--contrast: var(--sb-color-text); font-weight: var(--sb-font-weight-bold); color: var(--sb-color-gray-dark-3); text-decoration-color: var(--sb-color-green-dark); @@ -531,28 +557,6 @@ exports[`Anchor scss has to match theme css for sbanken 1`] = ` .dnb-anchor--inline { text-decoration-color: currentcolor; -} - -.dnb-anchor--contrast { - color: var(--color-white); -} -.dnb-anchor--contrast:hover { - color: var(--sb-color-text); - box-shadow: inset 100vw 100vw 0 0 var(--color-white), -0.125em 0 0 0 var(--color-white), 0.125em 0 0 0 var(--color-white); -} -.dnb-anchor--contrast:active { - color: var(--color-white); - background-color: transparent; - box-shadow: inset 100vw 100vw 0 0 transparent, -0.125em 0 0 0 transparent, 0.125em 0 0 0 transparent; -} -.dnb-anchor--contrast:focus-visible { - color: var(--color-white); - background-color: transparent; - outline: none; - --border-color: var(--color-white); - --border-width: var(--focus-ring-width); - box-shadow: 0 0 0 var(--border-width) var(--border-color); - border-color: transparent; }" `; @@ -564,54 +568,41 @@ exports[`Anchor scss has to match theme css for ui 1`] = ` /* * Utilities */ +/* + * Anchor theme + * + */ .dnb-anchor { - color: var(--color-sea-green); + --anchor-color: var(--anchor-color--default, var(--color-sea-green)); + --anchor-color--active: var(--color-mint-green); + --anchor-color--contrast: var(--color-emerald-green); + --anchor-background--hover: var(--color-mint-green-50); + --anchor-background--active: var(--color-emerald-green); + color: var(--anchor-color); } .dnb-anchor:hover { - color: var(--color-sea-green); - box-shadow: inset 100vw 100vw 0 0 var(--color-mint-green-50), -0.125em 0 0 0 var(--color-mint-green-50), 0.125em 0 0 0 var(--color-mint-green-50); + --anchor-color: var(--color-sea-green); + box-shadow: inset 100vw 100vw 0 0 var(--anchor-background--hover), -0.125em 0 0 0 var(--anchor-background--hover), 0.125em 0 0 0 var(--anchor-background--hover); } .dnb-anchor:active { - color: var(--color-mint-green); - box-shadow: inset 100vw 100vw 0 0 var(--color-emerald-green), -0.125em 0 0 0 var(--color-emerald-green), 0.125em 0 0 0 var(--color-emerald-green); + --anchor-color: var(--anchor-color--active); + box-shadow: inset 100vw 100vw 0 0 var(--anchor-background--active), -0.125em 0 0 0 var(--anchor-background--active), 0.125em 0 0 0 var(--anchor-background--active); } .dnb-anchor:focus-visible { - color: var(--color-sea-green); + --anchor-color: var(--color-sea-green); } .dnb-anchor--hover { - color: var(--color-sea-green); - box-shadow: inset 100vw 100vw 0 0 var(--color-mint-green-50), -0.125em 0 0 0 var(--color-mint-green-50), 0.125em 0 0 0 var(--color-mint-green-50); + --anchor-color: var(--color-sea-green); + box-shadow: inset 100vw 100vw 0 0 var(--anchor-background--hover), -0.125em 0 0 0 var(--anchor-background--hover), 0.125em 0 0 0 var(--anchor-background--hover); } .dnb-anchor--active { - color: var(--color-mint-green); - box-shadow: inset 100vw 100vw 0 0 var(--color-emerald-green), -0.125em 0 0 0 var(--color-emerald-green), 0.125em 0 0 0 var(--color-emerald-green); + --anchor-color: var(--anchor-color--active); + box-shadow: inset 100vw 100vw 0 0 var(--anchor-background--active), -0.125em 0 0 0 var(--anchor-background--active), 0.125em 0 0 0 var(--anchor-background--active); } .dnb-anchor--focus { - color: var(--color-sea-green); -} - -.dnb-anchor--contrast { - color: var(--color-white); -} -.dnb-anchor--contrast:hover { - color: var(--color-emerald-green); - box-shadow: inset 100vw 100vw 0 0 var(--color-white), -0.125em 0 0 0 var(--color-white), 0.125em 0 0 0 var(--color-white); -} -.dnb-anchor--contrast:active { - color: var(--color-white); - background-color: transparent; - box-shadow: inset 100vw 100vw 0 0 transparent, -0.125em 0 0 0 transparent, 0.125em 0 0 0 transparent; -} -.dnb-anchor--contrast:focus-visible { - color: var(--color-white); - background-color: transparent; - outline: none; - --border-color: var(--color-white); - --border-width: var(--focus-ring-width); - box-shadow: 0 0 0 var(--border-width) var(--border-color); - border-color: transparent; + --anchor-color: var(--color-sea-green); }" `; diff --git a/packages/dnb-eufemia/src/components/anchor/style/anchor-mixins.scss b/packages/dnb-eufemia/src/components/anchor/style/anchor-mixins.scss index 31e8a25d0fb..de84dc0da90 100644 --- a/packages/dnb-eufemia/src/components/anchor/style/anchor-mixins.scss +++ b/packages/dnb-eufemia/src/components/anchor/style/anchor-mixins.scss @@ -34,10 +34,6 @@ .dnb-h--x-small & { font-size: inherit; } - - @if mixin-exists('anchorDefaultStyleCustomisation') { - @include anchorDefaultStyleCustomisation(); - } } // reset methods @@ -75,20 +71,12 @@ border-radius: 0.25em; @include resetUnderlineStyle(); - - @if mixin-exists('anchorHoverStyleCustomisation') { - @include anchorHoverStyleCustomisation(); - } } @mixin anchorActiveStyle() { border-radius: 0.25em; @include resetUnderlineStyle(); - - @if mixin-exists('anchorActiveStyleCustomisation') { - @include anchorActiveStyleCustomisation(); - } } @mixin anchorFocusStyle() { @@ -115,11 +103,11 @@ } // other styles -@mixin useAnchorContrastStyle($contrastColor: var(--color-emerald-green)) { +@mixin useAnchorContrastStyle { color: var(--color-white); &:hover { - color: $contrastColor; + color: var(--anchor-color--contrast); @include anchorBackground(var(--color-white)); } diff --git a/packages/dnb-eufemia/src/components/anchor/style/dnb-anchor.scss b/packages/dnb-eufemia/src/components/anchor/style/dnb-anchor.scss index a37772e8672..880393328ff 100644 --- a/packages/dnb-eufemia/src/components/anchor/style/dnb-anchor.scss +++ b/packages/dnb-eufemia/src/components/anchor/style/dnb-anchor.scss @@ -19,6 +19,10 @@ button.dnb-anchor { .dnb-anchor { --anchor-underline-thickness: 0.0938rem; @include anchorStyle(); + + &.dnb-anchor--contrast { + @include useAnchorContrastStyle(); + } } .dnb-anchor--hover { diff --git a/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-eiendom.scss b/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-eiendom.scss new file mode 100644 index 00000000000..8acb19318f4 --- /dev/null +++ b/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-eiendom.scss @@ -0,0 +1,15 @@ +/* + * Anchor theme + * + */ + +@use './dnb-anchor-theme-ui.scss'; +@use '../anchor-mixins.scss'; + +.dnb-anchor { + --anchor-color--default: var(--color-emerald-green); + --anchor-color--contrast: var(--color-sea-green); + --anchor-color--active: var(--color-sea-green); + --anchor-background--hover: transparent; + --anchor-background--active: var(--color-pistachio); +} diff --git a/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-sbanken.scss b/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-sbanken.scss index 2ccd1f915ec..f7e7d639494 100644 --- a/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-sbanken.scss +++ b/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-sbanken.scss @@ -1,3 +1,8 @@ +/* + * Anchor theme + * + */ + @use '../anchor-mixins.scss'; @mixin anchorHover() { @@ -39,6 +44,7 @@ .dnb-anchor { --anchor-underline-thickness: 0.125rem; --anchor-background: transparent; + --anchor-color--contrast: var(--sb-color-text); // Has to use --sb-font-weight-bold to get correct weighting as --sb-font-weight-medium does nothing at the moment font-weight: var(--sb-font-weight-bold); @@ -145,8 +151,3 @@ .dnb-anchor--inline { text-decoration-color: currentcolor; } - -// TODO: add correct contrast styling when designs are in place -.dnb-anchor--contrast { - @include anchor-mixins.useAnchorContrastStyle(var(--sb-color-text)); -} diff --git a/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-ui.scss b/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-ui.scss index ea01287d42c..457d768b219 100644 --- a/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-ui.scss +++ b/packages/dnb-eufemia/src/components/anchor/style/themes/dnb-anchor-theme-ui.scss @@ -1,20 +1,45 @@ +/* + * Anchor theme + * + */ + @use '../anchor-mixins.scss'; +@mixin anchorHover { + --anchor-color: var(--color-sea-green); + @include anchor-mixins.anchorBackground(var(--anchor-background--hover)); +} + +@mixin anchorActive { + --anchor-color: var(--anchor-color--active); + @include anchor-mixins.anchorBackground( + var(--anchor-background--active) + ); +} + +@mixin anchorFocus { + --anchor-color: var(--color-sea-green); +} + @mixin anchorStyle() { - color: var(--color-sea-green); + --anchor-color: var(--anchor-color--default, var(--color-sea-green)); + --anchor-color--active: var(--color-mint-green); + --anchor-color--contrast: var(--color-emerald-green); + --anchor-background--hover: var(--color-mint-green-50); + --anchor-background--active: var(--color-emerald-green); + + color: var(--anchor-color); &:hover { - color: var(--color-sea-green); - @include anchor-mixins.anchorBackground(var(--color-mint-green-50)); + @include anchorHover(); } &:active { - color: var(--color-mint-green); - @include anchor-mixins.anchorBackground(var(--color-emerald-green)); + @include anchorActive(); } &:focus-visible { - color: var(--color-sea-green); + @include anchorFocus(); } } @@ -25,21 +50,15 @@ $useClasses: true !default; } .dnb-anchor--hover { - color: var(--color-sea-green); - @include anchor-mixins.anchorBackground(var(--color-mint-green-50)); + @include anchorHover(); } .dnb-anchor--active { - color: var(--color-mint-green); - @include anchor-mixins.anchorBackground(var(--color-emerald-green)); + @include anchorActive(); } .dnb-anchor--focus { - color: var(--color-sea-green); - } - - .dnb-anchor--contrast { - @include anchor-mixins.useAnchorContrastStyle(); + @include anchorFocus(); } } diff --git a/packages/dnb-eufemia/src/components/button/style/themes/dnb-button-theme-eiendom.scss b/packages/dnb-eufemia/src/components/button/style/themes/dnb-button-theme-eiendom.scss index 0bd1997e54c..7d52e206475 100644 --- a/packages/dnb-eufemia/src/components/button/style/themes/dnb-button-theme-eiendom.scss +++ b/packages/dnb-eufemia/src/components/button/style/themes/dnb-button-theme-eiendom.scss @@ -5,14 +5,6 @@ @import './dnb-button-theme-ui.scss'; -@mixin eiendomButtonDisabled() { - color: var(--color-black-55); - background-color: var(--color-white); - - // only because of href/anchor button - @include fakeBorder(var(--color-black-55)); -} - .dnb-button--primary { background-color: var(--color-emerald-green); diff --git a/packages/dnb-eufemia/src/components/section/__tests__/__snapshots__/Section.test.tsx.snap b/packages/dnb-eufemia/src/components/section/__tests__/__snapshots__/Section.test.tsx.snap index 1012e0cc93d..9e04aebbb25 100644 --- a/packages/dnb-eufemia/src/components/section/__tests__/__snapshots__/Section.test.tsx.snap +++ b/packages/dnb-eufemia/src/components/section/__tests__/__snapshots__/Section.test.tsx.snap @@ -182,7 +182,7 @@ exports[`Section scss have to match default theme snapshot 1`] = ` color: var(--color-white); } .dnb-section--fire-red .dnb-anchor:hover, .dnb-section--emerald-green .dnb-anchor:hover, .dnb-section--sea-green .dnb-anchor:hover, .dnb-section--success .dnb-anchor:hover { - color: var(--color-emerald-green); + color: var(--anchor-color--contrast); box-shadow: inset 100vw 100vw 0 0 var(--color-white), -0.125em 0 0 0 var(--color-white), 0.125em 0 0 0 var(--color-white); } .dnb-section--fire-red .dnb-anchor:active, .dnb-section--emerald-green .dnb-anchor:active, .dnb-section--sea-green .dnb-anchor:active, .dnb-section--success .dnb-anchor:active { diff --git a/packages/dnb-eufemia/src/elements/typography/style/themes/dnb-typography-theme-eiendom.scss b/packages/dnb-eufemia/src/elements/typography/style/themes/dnb-typography-theme-eiendom.scss index 9bcb79e6c77..7523fe40570 100644 --- a/packages/dnb-eufemia/src/elements/typography/style/themes/dnb-typography-theme-eiendom.scss +++ b/packages/dnb-eufemia/src/elements/typography/style/themes/dnb-typography-theme-eiendom.scss @@ -1,3 +1,4 @@ +@use './dnb-typography-theme-ui.scss'; @use '../typography-mixins.scss' as typography; @include typography.typographySelectors() { diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-basis.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-basis.scss index b005a69d6ca..c717505fa0c 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-basis.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-basis.scss @@ -3,21 +3,7 @@ * */ -@mixin anchorDefaultStyleCustomisation() { - color: var(--color-emerald-green); -} - -@mixin anchorHoverStyleCustomisation() { - color: var(--color-sea-green); - background-color: transparent; -} - -@mixin anchorActiveStyleCustomisation() { - color: var(--color-sea-green); - background-color: var(--color-pistachio); -} - -// import the default theme, and go from there -// will also have all the component themes included -@import '../theme-ui/ui-theme-basis.scss'; +@import './properties.scss'; +@import './fonts.scss'; @import './eiendom-theme-elements.scss'; +@import './globals.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-components.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-components.scss index d199c5cfb63..0f339a964cf 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-components.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-components.scss @@ -3,14 +3,57 @@ * But you still can change the content of this file on the very top. */ -// import the default theme, and go from there -// will also have all the component themes included -@import '../theme-ui/ui-theme-components.scss'; +// Add "ui" themes, if file don't exists +$THEME_FALLBACK: 'ui'; + +// Skeleton font needs a new path when loaded into /themes +$fonts-path: '../../../../assets/fonts/dnb' !default; + +// Import shared styles +@import '../../dnb-ui-components.scss'; /** * NB: The content below is auto generated by the "themeFactory". * You may want to update it by running "yarn build" locally. */ +@import '../../../components/anchor/style/themes/dnb-anchor-theme-eiendom.scss'; @import '../../../components/button/style/themes/dnb-button-theme-eiendom.scss'; @import '../../../components/tabs/style/themes/dnb-tabs-theme-eiendom.scss'; +@import '../../../components/accordion/style/themes/dnb-accordion-theme-ui.scss'; +@import '../../../components/autocomplete/style/themes/dnb-autocomplete-theme-ui.scss'; +@import '../../../components/avatar/style/themes/dnb-avatar-theme-ui.scss'; +@import '../../../components/badge/style/themes/dnb-badge-theme-ui.scss'; +@import '../../../components/checkbox/style/themes/dnb-checkbox-theme-ui.scss'; +@import '../../../components/date-picker/style/themes/dnb-date-picker-theme-ui.scss'; +@import '../../../components/dialog/style/themes/dnb-dialog-theme-ui.scss'; +@import '../../../components/drawer/style/themes/dnb-drawer-theme-ui.scss'; +@import '../../../components/dropdown/style/themes/dnb-dropdown-theme-ui.scss'; +@import '../../../components/form-label/style/themes/dnb-form-label-theme-ui.scss'; +@import '../../../components/form-row/style/themes/dnb-form-row-theme-ui.scss'; +@import '../../../components/form-set/style/themes/dnb-form-set-theme-ui.scss'; +@import '../../../components/form-status/style/themes/dnb-form-status-theme-ui.scss'; +@import '../../../components/global-error/style/themes/dnb-global-error-theme-ui.scss'; +@import '../../../components/global-status/style/themes/dnb-global-status-theme-ui.scss'; +@import '../../../components/help-button/style/themes/dnb-help-button-theme-ui.scss'; +@import '../../../components/icon/style/themes/dnb-icon-theme-ui.scss'; +@import '../../../components/input/style/themes/dnb-input-theme-ui.scss'; +@import '../../../components/logo/style/themes/dnb-logo-theme-ui.scss'; +@import '../../../components/modal/style/themes/dnb-modal-theme-ui.scss'; +@import '../../../components/pagination/style/themes/dnb-pagination-theme-ui.scss'; +@import '../../../components/progress-indicator/style/themes/dnb-progress-indicator-theme-ui.scss'; +@import '../../../components/radio/style/themes/dnb-radio-theme-ui.scss'; +@import '../../../components/section/style/themes/dnb-section-theme-ui.scss'; +@import '../../../components/skeleton/style/themes/dnb-skeleton-theme-ui.scss'; +@import '../../../components/slider/style/themes/dnb-slider-theme-ui.scss'; +@import '../../../components/space/style/themes/dnb-space-theme-ui.scss'; +@import '../../../components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss'; +@import '../../../components/switch/style/themes/dnb-switch-theme-ui.scss'; +@import '../../../components/table/style/themes/dnb-table-theme-ui.scss'; +@import '../../../components/textarea/style/themes/dnb-textarea-theme-ui.scss'; +@import '../../../components/timeline/style/themes/dnb-timeline-theme-ui.scss'; +@import '../../../components/toggle-button/style/themes/dnb-toggle-button-theme-ui.scss'; +@import '../../../components/tooltip/style/themes/dnb-tooltip-theme-ui.scss'; +@import '../../../components/upload/style/themes/dnb-upload-theme-ui.scss'; +@import '../../../fragments/drawer-list/style/themes/dnb-drawer-list-theme-ui.scss'; +@import '../../../fragments/scroll-view/style/themes/dnb-scroll-view-theme-ui.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-elements.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-elements.scss index 21fdb7b0585..cc5d63cbf7c 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-elements.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-elements.scss @@ -1,15 +1,23 @@ /** - * DNB Eufemia UI Theme - * + * ATTENTION: This file is auto generated by using "themeFactory". + * But you still can change the content of this file on the very top. */ -// import the default theme, and go from there -// will also have all the component themes included +// Add "ui" themes, if file don't exists +$THEME_FALLBACK: 'ui'; + +// Import shared styles +@import '../../dnb-ui-elements.scss'; /** - ATTENTION: This file is auto generated by using "styleFactory". - Do not change the content above! - All the themes get auto generated in here. -*/ + * NB: The content below is auto generated by the "themeFactory". + * You may want to update it by running "yarn build" locally. + */ @import '../../../elements/typography/style/themes/dnb-typography-theme-eiendom.scss'; +@import '../../../elements/blockquote/style/themes/dnb-blockquote-theme-ui.scss'; +@import '../../../elements/code/style/themes/dnb-code-theme-ui.scss'; +@import '../../../elements/hr/style/themes/dnb-hr-theme-ui.scss'; +@import '../../../elements/img/style/themes/dnb-img-theme-ui.scss'; +@import '../../../elements/label/style/themes/dnb-label-theme-ui.scss'; +@import '../../../elements/lists/style/themes/dnb-lists-theme-ui.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-extensions.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-extensions.scss index f4a00b1049c..97040d1cc22 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-extensions.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/eiendom-theme-extensions.scss @@ -1,14 +1,17 @@ /** - * DNB Eufemia UI Theme - * + * ATTENTION: This file is auto generated by using "themeFactory". + * But you still can change the content of this file on the very top. */ -// import the default theme, and go from there -// will also have all the component themes included -@import '../theme-ui/ui-theme-extensions.scss'; +// Add "ui" themes, if file don't exists +$THEME_FALLBACK: 'ui'; + +// Import shared styles +@import '../../dnb-ui-extensions.scss'; /** - ATTENTION: This file is auto generated by using "styleFactory". - Do not change the content above! - All the themes get auto generated in here. -*/ + * NB: The content below is auto generated by the "themeFactory". + * You may want to update it by running "yarn build" locally. + */ + +@import '../../../extensions/payment-card/style/themes/dnb-payment-card-theme-ui.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/fonts.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/fonts.scss new file mode 100644 index 00000000000..48d9d9259ec --- /dev/null +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/fonts.scss @@ -0,0 +1,2 @@ +// just uses ui theme fonts +@import '../theme-ui/fonts.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/globals.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/globals.scss new file mode 100644 index 00000000000..5f0db18c645 --- /dev/null +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/globals.scss @@ -0,0 +1,8 @@ +/* + * Global rules, a place to put rules, overrides and customizations that don't fit elsewhere. + */ + +@import './theme-mapping.scss'; + +// just uses ui theme globals +@import '../theme-ui/globals.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.js b/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.js index 06671cd3cdd..ea9d6c1e10e 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.js +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.js @@ -1,87 +1,6 @@ /** This file is auto generated by makePropertiesFile.js */ export default { - '--font-family-default': '"DNB", sans-serif', - '--font-family-monospace': '"DNBMono", "Menlo", "Consolas", "Roboto Mono",', - '--font-weight-default': 'normal', - '--font-weight-basis': 'normal', - '--font-weight-regular': 'normal', - '--font-weight-medium': '500', - '--font-weight-bold': '600', - '--font-size-x-small': '0.875rem', - '--font-size-small': '1rem', - '--font-size-basis': '1.125rem', - '--font-size-basis--em': '1em', - '--font-size-lead': 'var(--font-size-medium)', - '--font-size-medium': '1.25rem', - '--font-size-large': '1.625rem', - '--font-size-x-large': '2.125rem', - '--font-size-xx-large': '3rem', - '--line-height-xx-small--em': '1em', - '--line-height-x-small': '1.125rem', - '--line-height-small': '1.25rem', - '--line-height-basis': '1.5rem', - '--line-height-basis--em': '1.333em', - '--line-height-lead': '1.75rem', - '--line-height-medium': '2rem', - '--line-height-large': '2.5rem', - '--line-height-x-large': '3.5rem', - '--line-height-xx-large': 'var(--line-height-x-large)', - '--color-mint-green-50': '#d2f0e9', - '--color-mint-green-25': '#e9f8f4', - '--color-mint-green-12': '#f4fbf9', - '--color-sea-green-30': '#b3dada', - '--color-accent-yellow-30': '#feebc1', - '--color-signal-orange': '#ff5400', - '--color-fire-red': '#dc2a2a', - '--color-success-green': '#007b5e', - '--color-fire-red-8': '#fdeeee', - '--color-black': '#000', - '--color-black-80': '#333', - '--color-black-55': '#737373', - '--color-black-20': '#ccc', - '--color-black-8': '#ebebeb', - '--color-black-3': '#f8f8f8', - '--color-white': '#fff', - '--color-black-border': '#cdcdcd', - '--color-black-background': '#fafafa', - '--color-sea-green': '#007272', - '--color-mint-green': '#a5e1d2', - '--color-summer-green': '#28b482', - '--color-emerald-green': '#14555a', - '--color-ocean-green': '#00343e', - '--color-accent-yellow': '#fdbb31', - '--color-indigo': '#23195a', - '--color-violet': '#6e2382', - '--color-sky-blue': '#4bbed2', - '--color-lavender': '#f2f2f5', - '--color-sand-yellow': '#fbf6ec', - '--color-pistachio': '#f2f4ec', - '--color-mint-green-alt': '#ebfffa', - '--color-indigo-medium': '#6e6491', - '--color-indigo-light': '#b9afc8', - '--color-violet-medium': '#a06eaf', - '--color-violet-light': '#cfb9d7', - '--color-sky-blue-medium': '#87d2e1', - '--color-sky-blue-light': '#c3ebf0', - '--spacing-xx-small': '0.25rem', - '--spacing-x-small': '0.5rem', - '--spacing-small': '1rem', - '--spacing-medium': '1.5rem', - '--spacing-large': '2rem', - '--spacing-x-large': '3rem', - '--spacing-xx-large': '3.5rem', - '--layout-small': '40em', - '--layout-medium': '60em', - '--layout-large': '72em', - '--layout-x-large': '80em', - '--layout-xx-large': '90em', - '--shadow-default': '0 8px 16px rgb(51 51 51 / 8%)', - '--shadow-default-x': '0', - '--shadow-default-y': '8px', - '--shadow-default-blur-radius': '16px', - '--shadow-default-color': 'rgb(51 51 51 / 8%)', - '--easing-default': 'cubic-bezier(0.42, 0, 0, 1)', '--color-emerald-green-50': '#89aaac', '--color-emerald-green-25': '#c4d4d6', '--color-emerald-green-10': '#e8eeef' diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.scss index 4182fa55dbd..31c8f832c83 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/properties.scss @@ -1,17 +1,11 @@ /* - * CSS Properties + * CSS Properties Eiendom * */ -// change some properties -@mixin propertiesCustomisation() { +:root { // eiendom colors --color-emerald-green-50: #89aaac; --color-emerald-green-25: #c4d4d6; --color-emerald-green-10: #e8eeef; - - // Overwriting UX colors, defined in properties.scss - --color-mint-green-12: #f4fbf9; } - -@import '../theme-ui/properties.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-eiendom/theme-mapping.scss b/packages/dnb-eufemia/src/style/themes/theme-eiendom/theme-mapping.scss new file mode 100644 index 00000000000..e96d24e1459 --- /dev/null +++ b/packages/dnb-eufemia/src/style/themes/theme-eiendom/theme-mapping.scss @@ -0,0 +1,12 @@ +/** + * Eiendom UI Theme + * Overrides css variables from the ui theme + */ + +// WIP: Remove this import as soon as we have a mapping for all existing properties +@import '../theme-ui/properties.scss'; + +.eufemia-theme__eiendom, +:root { + // no overrides +} diff --git a/packages/dnb-eufemia/src/style/themes/theme-sbanken/customisations.scss b/packages/dnb-eufemia/src/style/themes/theme-sbanken/customisations.scss deleted file mode 100644 index 40a7b432b6f..00000000000 --- a/packages/dnb-eufemia/src/style/themes/theme-sbanken/customisations.scss +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Sbanken UI Theme - * - */ - -// change some properties -@mixin propertiesCustomisation() { - // WIP: for now we replace all usage of "--font-family-default" - --font-family-default: var(--sb-font-family-default); - - // Sbanken has no medium weight, so we overwrite it with bold - --font-weight-medium: var(--sb-font-weight-bold); - - // WIP: for now we replace all sizes - --font-size-x-small: var(--sb-font-size-x-small); - --font-size-small: var(--sb-font-size-small); - --font-size-basis: var(--sb-font-size-basis); - --font-size-basis--em: var(--sb-font-size-basis--em); - --font-size-lead: var(--sb-font-size-lead); - --font-size-large: var(--sb-font-size-large); - --font-size-x-large: var(--sb-font-size-x-large); - --font-size-xx-large: var(--sb-font-size-xx-large); - - // WIP: for now we replace all heights - --line-height-x-small: var(--sb-line-height-x-small); - --line-height-small: var(--sb-line-height-small); - --line-height-basis: var(--sb-line-height-basis); - --line-height-basis--em: var(--sb-line-height-basis--em); - --line-height-lead: var(--sb-line-height-lead); - --line-height-medium: var(--sb-line-height-medium); - --line-height-large: var(--sb-line-height-large); - --line-height-x-large: var(--sb-line-height-x-large); - - // Scrollbar - --scrollbar-track-width: 0.5rem; - --scrollbar-thumb-width: 0.5rem; - --scrollbar-track-color: var(--sb-color-gray-light-2); - --scrollbar-thumb-color: var(--sb-color-gray-dark-3); - --scrollbar-thumb-hover-color: var(--sb-color-purple); - - // Skeleton - --skeleton-color: var(--sb-color-gray-light-2); - --skeleton-color--contrast: var(--sb-color-white); -} diff --git a/packages/dnb-eufemia/src/style/themes/theme-sbanken/globals.scss b/packages/dnb-eufemia/src/style/themes/theme-sbanken/globals.scss new file mode 100644 index 00000000000..450741abd81 --- /dev/null +++ b/packages/dnb-eufemia/src/style/themes/theme-sbanken/globals.scss @@ -0,0 +1,32 @@ +/* + * Global rules, a place to put rules, overrides and customizations that don't fit elsewhere. + */ + +@import './theme-mapping.scss'; + +:root { + // Focus Ring + --focus-ring-width: 0.1875rem; + --focus-ring-color: var(--sb-color-blue-dark); + + // Scrollbar + --scrollbar-track-width: 0.5rem; + --scrollbar-thumb-width: 0.5rem; + --scrollbar-track-color: var(--sb-color-gray-light-2); + --scrollbar-thumb-color: var(--sb-color-gray-dark-3); + --scrollbar-thumb-hover-color: var(--sb-color-purple); + + // Skeleton + --skeleton-color: var(--sb-color-gray-light-2); + --skeleton-color--contrast: var(--sb-color-white); +} + +// ::selection appearance helper +.dnb-selection::selection, +.dnb-selection ::selection, +[class^='dnb-']::selection, +[class^='dnb-'] ::selection { + background-color: var(--sb-color-blue-light-2); + color: var(--sb-color-black); + text-shadow: none; +} diff --git a/packages/dnb-eufemia/src/style/themes/theme-sbanken/properties.scss b/packages/dnb-eufemia/src/style/themes/theme-sbanken/properties.scss index ecff7ff8061..ce1de98faec 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-sbanken/properties.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-sbanken/properties.scss @@ -1,9 +1,9 @@ /* - * CSS Properties + * CSS Properties Sbanken * */ -@mixin getDefaultProperties() { +:root { // Typography Family --sb-font-family-default: 'Roboto', 'Helvetica', 'Arial', sans-serif; --sb-font-family-headings: 'MaisonNeueHeadings', 'Roboto', 'Helvetica', @@ -117,12 +117,4 @@ // Easing --sb-easing-default: cubic-bezier(0.42, 0, 0, 1); - - @if mixin-exists('propertiesCustomisation') { - @include propertiesCustomisation(); - } -} - -:root { - @include getDefaultProperties(); } diff --git a/packages/dnb-eufemia/src/style/themes/theme-sbanken/sbanken-theme-basis.scss b/packages/dnb-eufemia/src/style/themes/theme-sbanken/sbanken-theme-basis.scss index 99b6489ae19..c8afa99179d 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-sbanken/sbanken-theme-basis.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-sbanken/sbanken-theme-basis.scss @@ -3,26 +3,7 @@ * */ -// WIP: Remove this import as soon as we have a mapping for all existing properties -@import '../theme-ui/properties.scss'; - -@import './customisations.scss'; // WIP: remove when styles are removed -@import './fonts.scss'; @import './properties.scss'; -@import './theme-mapping.scss'; // after "properties" - +@import './fonts.scss'; @import './sbanken-theme-elements.scss'; - -:root { - --theme-color-body: var(--sb-color-text); -} - -// ::selection appearance helper -.dnb-selection::selection, -.dnb-selection ::selection, -[class^='dnb-']::selection, -[class^='dnb-'] ::selection { - background-color: var(--sb-color-blue-light-2); - color: var(--sb-color-black); - text-shadow: none; -} +@import './globals.scss'; diff --git a/packages/dnb-eufemia/src/style/themes/theme-sbanken/theme-mapping.scss b/packages/dnb-eufemia/src/style/themes/theme-sbanken/theme-mapping.scss index ce74a0c142b..881bc58ff8a 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-sbanken/theme-mapping.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-sbanken/theme-mapping.scss @@ -1,9 +1,15 @@ /** * Sbanken UI Theme - * + * Overrides css variables from the ui theme */ -.eufemia-theme__sbanken { +// WIP: Remove this import as soon as we have a mapping for all existing properties +@import '../theme-ui/properties.scss'; + +.eufemia-theme__sbanken, +:root { + --theme-color-body: var(--sb-color-text); + // font-family --font-family-default: var(--sb-font-family-default); @@ -31,8 +37,4 @@ --line-height-large: var(--sb-line-height-large); --line-height-x-large: var(--sb-line-height-x-large); --line-height-xx-large: var(--sb-line-height-xx-large); - - // Form properties - --focus-ring-width: 0.1875rem; - --focus-ring-color: var(--sb-color-blue-dark); } diff --git a/packages/dnb-eufemia/src/style/themes/theme-ui/globals.scss b/packages/dnb-eufemia/src/style/themes/theme-ui/globals.scss new file mode 100644 index 00000000000..0ecd726a610 --- /dev/null +++ b/packages/dnb-eufemia/src/style/themes/theme-ui/globals.scss @@ -0,0 +1,30 @@ +/* + * Global rules, a place to put rules, overrides and customizations that don't fit elsewhere. + */ + +:root { + // Focus Ring + --focus-ring-width: 0.125rem; + --focus-ring-color: var(--color-emerald-green); + + // Scrollbar + --scrollbar-track-width: 0.5rem; + --scrollbar-thumb-width: 0.5rem; + --scrollbar-track-color: var(--color-black-8); + --scrollbar-thumb-color: var(--color-sea-green); + --scrollbar-thumb-hover-color: var(--color-emerald-green); + + // Skeleton + --skeleton-color: var(--color-black-8); + --skeleton-color--contrast: var(--color-white); +} + +// ::selection appearance helper +.dnb-selection::selection, +.dnb-selection ::selection, +[class^='dnb-']::selection, +[class^='dnb-'] ::selection { + background-color: var(--color-mint-green); + color: var(--color-black); + text-shadow: none; +} diff --git a/packages/dnb-eufemia/src/style/themes/theme-ui/properties.scss b/packages/dnb-eufemia/src/style/themes/theme-ui/properties.scss index ddd5d4e5599..241cb884cf0 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-ui/properties.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-ui/properties.scss @@ -1,9 +1,9 @@ /* - * CSS Properties + * CSS Properties Ui * */ -@mixin getDefaultProperties() { +:root { // Typography Family --font-family-default: 'DNB', sans-serif; --font-family-monospace: 'DNBMono', 'Menlo', 'Consolas', 'Roboto Mono', @@ -110,12 +110,4 @@ // Easing --easing-default: cubic-bezier(0.42, 0, 0, 1); - - @if mixin-exists('propertiesCustomisation') { - @include propertiesCustomisation(); - } -} - -:root { - @include getDefaultProperties(); } diff --git a/packages/dnb-eufemia/src/style/themes/theme-ui/ui-theme-basis.scss b/packages/dnb-eufemia/src/style/themes/theme-ui/ui-theme-basis.scss index 8f237ea11eb..f9aa7cac264 100644 --- a/packages/dnb-eufemia/src/style/themes/theme-ui/ui-theme-basis.scss +++ b/packages/dnb-eufemia/src/style/themes/theme-ui/ui-theme-basis.scss @@ -6,30 +6,4 @@ @import './properties.scss'; @import './fonts.scss'; @import './ui-theme-elements.scss'; - -:root { - // Focus Ring - --focus-ring-width: 0.125rem; - --focus-ring-color: var(--color-emerald-green); - - // Scrollbar - --scrollbar-track-width: 0.5rem; - --scrollbar-thumb-width: 0.5rem; - --scrollbar-track-color: var(--color-black-8); - --scrollbar-thumb-color: var(--color-sea-green); - --scrollbar-thumb-hover-color: var(--color-emerald-green); - - // Skeleton - --skeleton-color: var(--color-black-8); - --skeleton-color--contrast: var(--color-white); -} - -// ::selection appearance helper -.dnb-selection::selection, -.dnb-selection ::selection, -[class^='dnb-']::selection, -[class^='dnb-'] ::selection { - background-color: var(--color-mint-green); - color: var(--color-black); - text-shadow: none; -} +@import './globals.scss';