Skip to content

Commit

Permalink
Adjust visually hidden component
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarnef committed Oct 3, 2023
1 parent 41b2e58 commit b735ce7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/uui-visually-hidden/lib/uui-visually-hidden.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ import { css, html, LitElement } from 'lit';
export class UUIVisuallyHiddenElement extends LitElement {
static styles = [
css`
:host {
/* Styles goes here */
:host(:not(:focus-within)) {
position: absolute !important;
width: 1px !important;
height: 1px !important;
clip: rect(0 0 0 0) !important;
clip-path: inset(50%) !important;
border: none !important;
overflow: hidden !important;
white-space: nowrap !important;
padding: 0 !important;
}
`,
];

render(){
return html`
Markup goes here
`;
render() {
return html`<slot></slot>`;
}
}

Expand Down
13 changes: 13 additions & 0 deletions packages/uui-visually-hidden/lib/uui-visually-hidden.story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ export default meta;
type Story = StoryObj<UUIVisuallyHiddenElement>;

export const Overview: Story = {};

export const SkipNavigation: Story = {
args: {},
parameters: {
docs: {
source: {
code: `<uui-visually-hidden>
<a href="#">Skip to main content</a>
</uui-visually-hidden>`,
},
},
},
};

0 comments on commit b735ce7

Please sign in to comment.