Skip to content

Commit

Permalink
feat(Helpers): deprecate .dnb-sr-only--inline & .dnb-not-sr-only (#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored and tujoworker committed Feb 23, 2023
1 parent a4e0032 commit 8d73d6f
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,6 @@ export function ScreenReaderOnlyExample() {
)
}

export function NoScreenReaderExample() {
return (
<Wrapper className="dnb-spacing">
<ComponentBox hideCode data-visual-test="helper-not-sr-only">
{
/* jsx */ `
<p className="dnb-p dnb-sr-only dnb-not-sr-only">
I'm the opposite of .dnb-sr-only, so you should be able to see
me.
</p>
`
}
</ComponentBox>
</Wrapper>
)
}

export function SelectionExample() {
return (
<Wrapper className="dnb-spacing">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ CoreStyleExample,
TabFocusExample,
UnstyledListExample,
ScreenReaderOnlyExample,
NoScreenReaderExample,
SelectionExample
} from 'Docs/uilib/helpers/Examples'
import SkipLinkExample from 'Docs/uilib/usage/accessibility/examples/skip-link-example.js'
Expand Down Expand Up @@ -105,24 +104,6 @@ Visually hides an element, but is still reachable by screen readers. (_sr_ stand

<ScreenReaderOnlyExample />

### Screen Reader only: inline

`dnb-sr-only--inline` (deprecated in v10)

Like `dnb-sr-only` - but with flow elements in mind. This enables a set of text (in a paragraph `<p>`) to be enhanced with spans inside without NVDA to split up reading the text.

### Not Screen Reader only

`dnb-not-sr-only` (deprecated in v10)

The opposite of `dnb-sr-only`, so not visible to screen readers.

```html
<p>text <span class="dnb-sr-only--inline">sr-only</span> text</p>
```

<NoScreenReaderExample />

## Drop shadow

`dnb-drop-shadow`
Expand Down Expand Up @@ -212,8 +193,6 @@ You can import Eufemia _mixins_ directly into your SCSS styles:
/** Screen Reader Only */
@include srOnly() {
} // .dnb-sr-only
@include srOnlyInline() {
} // .dnb-sr-only--inline

/** Browser Checks */
@include IS_EDGE {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
TabFocusExample,
UnstyledListExample,
ScreenReaderOnlyExample,
NoScreenReaderExample,
SelectionExample,
} from '../Examples'
import { warn } from '@dnb/eufemia/src/shared/component-helper'
Expand Down Expand Up @@ -36,7 +35,6 @@ export default function VisualTests() {
<TabFocusExample />
<UnstyledListExample />
<ScreenReaderOnlyExample />
<NoScreenReaderExample />
<SelectionExample />
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ describe('HelperClasses screenshot', () => {
expect(screenshot).toMatchImageSnapshot()
})

it('have to match not-sr-only', async () => {
const screenshot = await testPageScreenshot({
addWrapper: false,
selector: '[data-visual-test="helper-not-sr-only"]',
})
expect(screenshot).toMatchImageSnapshot()
})

it('have to match selection', async () => {
const screenshot = await testPageScreenshot({
addWrapper: false,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
@include srOnly();
}

// deprecated and can be removed in v10
.dnb-sr-only--inline {
@include srOnlyInline();
}
// deprecated and can be removed in v10
.dnb-not-sr-only {
@include notSrOnly();
}
.dnb-suffix {
padding-left: 0.5rem;

Expand Down
31 changes: 0 additions & 31 deletions packages/dnb-eufemia/src/style/core/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -319,37 +319,6 @@ $breakpoints: (
border: 0;
}

// deprecated and can be removed in v10
// Visual test and docs should be removed as well!
@mixin srOnlyInline() {
@include srOnly();

// since we do use it also as positioning helper
// we then do not want it absolute positioned
position: static;
display: inline-block;

visibility: visible; // should not be hidden!

font-size: 0;
line-height: 0;
}

// deprecated and can be removed in v10
// Visual test and docs should be removed as well!
@mixin notSrOnly() {
position: initial;
max-width: initial;
max-height: initial;

clip-path: initial;
overflow: auto;

font-size: initial;
line-height: initial;
white-space: initial;
}

@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);

Expand Down

0 comments on commit 8d73d6f

Please sign in to comment.