-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fieldset): add reset SASS mix-in
fieldsetReset
- Loading branch information
1 parent
a91ffc3
commit fa26edd
Showing
13 changed files
with
95 additions
and
95 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/dnb-design-system-portal/src/docs/uilib/helpers/Examples.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@import '@dnb/eufemia/src/style/core/utilities.scss'; | ||
|
||
.fieldsetReset { | ||
:global(fieldset) { | ||
@include fieldsetReset(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
packages/dnb-design-system-portal/src/docs/uilib/helpers/classes/visual-tests.js
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
packages/dnb-design-system-portal/src/docs/uilib/helpers/classes/visual-tests.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react' | ||
import * as Examples from '../Examples' | ||
|
||
export default function VisibleWhenVisualTests() { | ||
useSelection('[data-visual-test="helper-selection"] p') | ||
|
||
return Object.values(Examples).map((Component, i) => { | ||
return <Component key={i} /> | ||
}) | ||
} | ||
|
||
function useSelection(className: string) { | ||
// Selects/marks some of the text in SelectionExample on second render tick | ||
// For comparing screenshots | ||
React.useEffect(() => { | ||
const textNode = document.querySelector(className).childNodes[0] | ||
|
||
const range = new Range() | ||
range.setStart(textNode, 0) | ||
range.setEnd(textNode, Math.floor(textNode.textContent.length / 2)) | ||
|
||
// apply this range for document selection | ||
document.getSelection().addRange(range) | ||
}, []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+3.24 KB
...tests__/__image_snapshots__/helperclasses-have-to-match-fieldset-reset.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-21 Bytes
(100%)
...es/__tests__/__image_snapshots__/helperclasses-have-to-match-selection.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-19 Bytes
(99%)
...sses/__tests__/__image_snapshots__/helperclasses-have-to-match-sr-only.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters