Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Width fungerte ikke med inline-variant av skeleton #2273

Merged
merged 2 commits into from
Sep 13, 2023
Merged
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
6 changes: 6 additions & 0 deletions .changeset/blue-deers-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@navikt/ds-react": patch
"@navikt/ds-css": patch
---

Skeleton: Width fungerer nå med inline-variant av Skeleton
4 changes: 4 additions & 0 deletions @navikt/core/css/skeleton.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
pointer-events: none;
}

.navds-skeleton--inline {
display: inline-block;
}

.navds-skeleton--has-children {
color: transparent;
}
Expand Down
1 change: 1 addition & 0 deletions @navikt/core/react/src/skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(
"navds-skeleton--has-children": Boolean(children),
"navds-skeleton--no-height": !height,
"navds-skeleton--no-width": !width,
"navds-skeleton--inline": As === "span",
}
)}
style={{ ...style, width, height }}
Expand Down
7 changes: 4 additions & 3 deletions @navikt/core/react/src/skeleton/skeleton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ export const InlineText = {
render: () => (
<BodyLong>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur
voluptas sint dolore <Skeleton as="span">omnis quia consequatur</Skeleton>{" "}
beatae vero cum officia debitis. Quidem debitis omnis reprehenderit nobis
rerum. Nulla, magnam? Saepe, eveniet?
voluptas sint dolore <Skeleton width="40px" as="span" variant="text" />{" "}
beatae vero cum officia debitis. Quidem debitis omnis reprehenderit nobis{" "}
<Skeleton as="span">test text</Skeleton> rerum. Nulla, magnam? Saepe,
eveniet?
</BodyLong>
),
};