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

Tailwind: Fixed 'screen' -> 'screens' bug to properly adopt breakpoints. #3119

Merged
merged 4 commits into from
Sep 2, 2024

Conversation

KenAJoh
Copy link
Collaborator

@KenAJoh KenAJoh commented Aug 26, 2024

Description

Someone (me) can't type properly and as a consequence our tailwind-config did not properly adopt the 'screens' config for breakpoints added 1+ year ago.

Why is this a breaking change?

// Native Tailwind config
'sm': '640px',
'md': '768px',
'lg': '1024px',
'xl': '1280px',
'2xl': '1536px',

Every project using tailwind will have used these values for their breakpoints before. By changing to our breakpoints with this change, sm will now be 480px and 2xl will be 1440px.

  • Few if any will be affected by the 2xl change since one seldom use that breakpoint
  • Quite a few will most likely be affected by the sm-change. In most cases this will not actually require a code update on their side, but will need each project to check that everything still looks as it should. Worst case scenario might be elements not wrapping properly 🤔 The change itself is only a 160px difference, so the possibility for actual breaking changes are few.

Nice thing about the update is that each project can override this themselves by just adding two lines of code in their config. This allows them to update to next major without actually using this update. Since each project using tailwind already have a config, this will be quite easy to adopt.

extend: {
      screens: {
        'sm': '640px',
        '2xl': '1536px',
      },
    }

@KenAJoh KenAJoh added klar for gjennomgang 🔍 Aksel-V7 Oppgaven er relatert til ny major-release labels Aug 26, 2024
Copy link

changeset-bot bot commented Aug 26, 2024

🦋 Changeset detected

Latest commit: de3e561

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-tailwind Major
@navikt/ds-react Major
@navikt/ds-css Major
@navikt/ds-tokens Major
@navikt/aksel-icons Major
@navikt/aksel Major
@navikt/aksel-stylelint Major

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

@HalvorHaugan HalvorHaugan left a comment

Choose a reason for hiding this comment

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

LGTM

@KenAJoh KenAJoh merged commit c40a979 into aksel-v7 Sep 2, 2024
1 check passed
@KenAJoh KenAJoh deleted the tailwind-screens-bug branch September 2, 2024 10:47
HalvorHaugan added a commit that referenced this pull request Sep 13, 2024
* Tooltip labeling (#3094)

* feat: Better labeling of Tooltip

* feat: Better keyshortcuts for screenreaders in Tooltip

* memo: Updated story

* bug: Better error logging for example-parsing

* refactor: describeChild -> describesChild

* fire: Removed extra story

* bug: removed extra tabIndex

* memo: Update Tooltip demo description

* Update aksel.nav.no/website/pages/eksempler/tooltip/labeling.tsx

Co-authored-by: Halvor Haugan <[email protected]>

* refactor: Updated defaultValue for describesChild

* bug: removed Tooltip prop from ToggleGroup

---------

Co-authored-by: Halvor Haugan <[email protected]>

* Tailwind: Fixed 'screen' -> 'screens' bug to properly adopt breakpoints. (#3119)

* 💥 Screen -> Screens in tailwind-config

* refactor: Adopt updated screens-config in Aksel.nav.no project

* Icons: Removed old and renamed icons (#3120)

* 💥 Removed renamed icons

* ErrorSummary: Add fallback for heading + better focus handling (#3140)

Co-authored-by: Ken <[email protected]>
Co-authored-by: Ken <[email protected]>

Co-authored-by: Halvor Haugan <[email protected]>

* feat: Added composeEventHandlers to onFocus in ErrorSummary

* memo: Removed inaccurate description for tooltip demo

* feat: Omitted tabIndex from ErrorSummary

---------

Co-authored-by: Ken <[email protected]>
Co-authored-by: Ken <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aksel-V7 Oppgaven er relatert til ny major-release klar for gjennomgang 🔍
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants