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

Alert: Misc. adjustments #3007

Merged
merged 10 commits into from
Jun 20, 2024
Merged

Alert: Misc. adjustments #3007

merged 10 commits into from
Jun 20, 2024

Conversation

HalvorHaugan
Copy link
Contributor

@HalvorHaugan HalvorHaugan commented Jun 17, 2024

Copy link

changeset-bot bot commented Jun 17, 2024

🦋 Changeset detected

Latest commit: 779a514

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@navikt/ds-react Patch
@navikt/ds-css Patch
@navikt/aksel-stylelint Patch
@navikt/aksel Patch
@navikt/ds-tokens Patch
@navikt/ds-tailwind Patch
@navikt/aksel-icons Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jun 17, 2024

Storybook demo

Endringer til review: 1

ec5b49e45 | 85 komponenter | 160 stories

@HalvorHaugan HalvorHaugan marked this pull request as ready for review June 19, 2024 11:46
as="div"
size={size}
className="navds-alert__wrapper"
style={contentMaxWidth ? { maxWidth: "43.5rem" } : undefined}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will prob break some applications since inline-styles are the most specific when it comes to CSS-overrides. Maybe something like this could be non-breaking

className={cl("navds-alert__wrapper", {"navds-alert__wrapper--no-maxwidth": !contentMaxWidth})}

:where(.navds-alert__wrapper:not(.navds-alert__wrapper--no-maxwidth)) {
  max-width: 43.5rem;
}

Since :where is used it will have 0 specificity even when using not (not tested here so might not be 100% correct)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that inline style was a bad idea 😅 But do we need :where? Doesn't custom css always come after ds-css?

.navds-alert__wrapper--maxwidth {
  max-width: 43.5rem;
}
.navds-alert__wrapper {
  max-width: 100px; /* <-- works */
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No could probably simplify it 👍 As long as targeting navds-alert__wrapper still allows those who have overwritten it now won't notice any changes.

@HalvorHaugan HalvorHaugan enabled auto-merge (squash) June 20, 2024 11:42
@HalvorHaugan HalvorHaugan merged commit 23ea323 into main Jun 20, 2024
3 checks passed
@HalvorHaugan HalvorHaugan deleted the alert-adjustments branch June 20, 2024 11:43
@github-actions github-actions bot mentioned this pull request Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants