feat(lib): migrate breakpoints from infix to prefix#3499
feat(lib): migrate breakpoints from infix to prefix#3499MaxLardenois wants to merge 21 commits intoouds/mainfrom
Conversation
✅ Deploy Preview for boosted ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR migrates responsive breakpoint utilities from an infix naming convention (e.g. mb-md-none, col-md-6) to a Tailwind/Bootstrap-v6-style prefix convention (e.g. md:mb-none, md:col-6) across the docs site and the SCSS generator, while adding an optional Bootstrap-compatibility mode.
Changes:
- Introduces a breakpoint-prefix mechanism in SCSS (escaped
:) and updates utility/grid generation to emitbp:...classnames. - Adds/extends Bootstrap compatibility generation paths (infix-style classes) gated by
$enable-bootstrap-compatibility. - Updates site docs/examples/templates/tests/config to use the new prefix notation.
Reviewed changes
Copilot reviewed 87 out of 89 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| site/src/scss/docs_prod.scss | Enables Bootstrap compatibility for production docs SCSS build. |
| site/src/scss/docs.scss | Enables Bootstrap compatibility for docs SCSS build. |
| site/src/scss/_component-examples.scss | Expands example selectors to account for :col prefixed responsive classes. |
| site/src/pages/resources.astro | Migrates grid column classes to prefix breakpoint notation. |
| site/src/pages/[brand]/index.astro | Migrates responsive flex/alignment utility usage to prefix notation. |
| site/src/pages/[brand]/docs/versions.astro | Migrates responsive grid classes to prefix notation. |
| site/src/pages/[brand]/docs/[version]/examples/index.astro | Migrates responsive flex/spacing utilities to prefix notation. |
| site/src/libs/data.ts | Tightens TS return types via assertions for cached/parsed data. |
| site/src/layouts/partials/ThemeToggler.astro | Migrates d-lg-none → lg:d-none. |
| site/src/layouts/partials/ExamplesMain.astro | Migrates responsive grid classes to prefix notation. |
| site/src/layouts/SingleLayout.astro | Migrates responsive spacing utilities to prefix notation. |
| site/src/layouts/DocsLayout.astro | Migrates many responsive layout utilities to prefix notation. |
| site/src/content/docs/utilities/text.mdx | Updates responsive text alignment examples to prefix notation. |
| site/src/content/docs/utilities/stretched-link.mdx | Updates responsive grid/spacing examples to prefix notation. |
| site/src/content/docs/utilities/stack.mdx | Updates responsive grid usage in examples to prefix notation. |
| site/src/content/docs/utilities/spacing.mdx | Updates notation docs + examples to prefix notation. |
| site/src/content/docs/utilities/position.mdx | Adds prefix notation examples and wraps Bootstrap-style examples in compatibility block. |
| site/src/content/docs/utilities/overflow.mdx | Updates responsive display/spacing utilities in examples to prefix notation. |
| site/src/content/docs/utilities/opacity.mdx | Updates responsive display utility in examples to prefix notation. |
| site/src/content/docs/utilities/object-fit.mdx | Updates responsive object-fit docs/examples; adds compatibility section. |
| site/src/content/docs/utilities/float.mdx | Updates responsive float docs/examples; adds compatibility section. |
| site/src/content/docs/utilities/flex.mdx | Updates responsive flex docs; adds compatibility section. |
| site/src/content/docs/utilities/display.mdx | Updates display docs/examples for prefix notation; adds print prefix docs + compatibility block. |
| site/src/content/docs/utilities/api.mdx | Updates utilities API docs to show escaped : selectors and print prefix behavior. |
| site/src/content/docs/layout/utilities.mdx | Updates responsive utility references to prefix notation. |
| site/src/content/docs/layout/gutters.mdx | Updates gutter/grid examples to prefix notation. |
| site/src/content/docs/layout/grid.mdx | Updates grid docs/examples and adds compatibility blocks for old naming. |
| site/src/content/docs/layout/css-grid.mdx | Adds prefix notation example + compatibility block. |
| site/src/content/docs/layout/columns.mdx | Adds prefix notation examples + compatibility block; updates order/offset/margins examples. |
| site/src/content/docs/layout/breakpoints.mdx | Removes Sass map mention snippet from docs page. |
| site/src/content/docs/getting-started/migration.mdx | Updates migration guide examples to prefix notation. |
| site/src/content/docs/getting-started/migration-from-boosted.mdx | Updates Boosted migration notes for prefix notation. |
| site/src/content/docs/foundation/typography.mdx | Updates grid-based examples to prefix notation. |
| site/src/content/docs/foundation/options.mdx | Updates option docs examples to prefix notation. |
| site/src/content/docs/foundation/color-palette.mdx | Updates grid examples to prefix notation. |
| site/src/content/docs/foundation/approach.mdx | Updates responsive display example to prefix notation. |
| site/src/content/docs/components/tags.mdx | Updates row-cols responsive class to prefix notation. |
| site/src/content/docs/components/switch.mdx | Updates responsive grid examples to prefix notation. |
| site/src/content/docs/components/radio-button.mdx | Updates responsive grid examples to prefix notation. |
| site/src/content/docs/components/icon.mdx | Updates responsive gap example to prefix notation; adjusts an icon class name. |
| site/src/content/docs/components/header.mdx | Updates navbar expand + spacing + display utilities to prefix notation. |
| site/src/content/docs/components/footer.mdx | Updates responsive grid/display/spacing utilities to prefix notation. |
| site/src/content/docs/components/chips.mdx | Updates row-cols responsive class to prefix notation. |
| site/src/content/docs/components/checkbox.mdx | Updates responsive flex/grid examples to prefix notation. |
| site/src/content/docs/components/buttons.mdx | Updates responsive display/flex/spacing examples to prefix notation. |
| site/src/content/docs/components/badges.mdx | Updates row-cols responsive class to prefix notation. |
| site/src/content/docs/components/alerts.mdx | Updates row-cols responsive class to prefix notation. |
| site/src/content/docs/components.mdx | Updates responsive row-cols classes to prefix notation. |
| site/src/components/shortcodes/Example.astro | Migrates responsive d-md-flex usage in snippet UI to prefix notation. |
| site/src/components/shortcodes/Code.astro | Migrates responsive padding utility to prefix notation. |
| site/src/components/shortcodes/BootstrapCompatibility.astro | Migrates responsive float utility to prefix notation in the callout header. |
| site/src/components/home/MastHead.astro | Migrates responsive grid/display utilities to prefix notation. |
| site/src/components/home/GetStarted.astro | Migrates responsive grid/display/spacing utilities to prefix notation. |
| site/src/components/home/Customize.astro | Migrates responsive grid/display/spacing utilities to prefix notation. |
| site/src/components/home/CSSVariables.astro | Migrates responsive grid/display/spacing utilities to prefix notation. |
| site/src/components/header/Versions.astro | Migrates responsive display/spacing utilities to prefix notation. |
| site/src/components/header/SubNav.astro | Migrates responsive display utility to prefix notation. |
| site/src/components/header/Skippy.astro | Migrates responsive display utility to prefix notation. |
| site/src/components/header/Navigation.astro | Migrates navbar expand + spacing + display utilities to prefix notation. |
| site/src/components/footer/Footer.astro | Migrates responsive grid/display/spacing utilities to prefix notation. |
| site/src/components/DocsSidebar.astro | Migrates responsive padding utilities to prefix notation. |
| site/src/assets/examples/grid/index.astro | Migrates example markup to prefix notation. |
| site/src/assets/examples/download-app/index.astro | Migrates many responsive utilities to prefix notation. |
| site/data/breakpoints.yml | Changes breakpoint abbreviations from -md style to md style to support prefix rendering. |
| scss/utilities/_api.scss | Updates utility generation to use breakpoint prefixes + adds bootstrap-compatible variants + print prefix. |
| scss/tests/utilities/_api.test.scss | Updates expected selectors to escaped-colon prefix form. |
| scss/tests/mixins/_utilities.test.scss | Updates tests for new generate-utility prefix parameterization. |
| scss/mixins/_utilities.scss | Changes utility generator to accept breakpoint prefix + infix separately and emit prefixed selectors. |
| scss/mixins/_grid.scss | Migrates grid/css-grid/gutter class generation to prefix notation + adds bootstrap compatibility emission. |
| scss/mixins/_breakpoints.scss | Adds breakpoint-prefix() + CSS identifier escaping helper for leading digits. |
| scss/helpers/_position.scss | Migrates sticky helpers to prefix notation + adds bootstrap compatibility aliases. |
| scss/_utilities.scss | Adds responsive-bootstrap flags across utilities to drive compatibility generation. |
| scss/_tables.scss | Migrates table responsive helpers to prefix notation + adds bootstrap compatibility aliasing. |
| scss/_offcanvas.scss | Migrates offcanvas responsive helpers to prefix notation + adds bootstrap compatibility aliasing. |
| scss/_navbar.scss | Migrates navbar expand variants to prefix notation + adds bootstrap compatibility aliasing. |
| scss/_modal.scss | Migrates modal fullscreen-down helpers to prefix notation + adds bootstrap compatibility aliasing. |
| scss/_maps.scss | Adjusts $gutters default mapping and removes conditional merge behavior. |
| scss/_list-group.scss | Migrates list-group horizontal responsive helpers to prefix notation + adds bootstrap compatibility aliasing. |
| scss/_dropdown.scss | Migrates responsive dropdown alignment helpers to prefix notation + adds bootstrap compatibility aliasing. |
| js/tests/visual/tooltip.html | Migrates responsive grid markup to prefix notation. |
| js/tests/visual/toast.html | Migrates responsive grid markup to prefix notation. |
| js/tests/visual/scrollspy.html | Migrates navbar expand class to prefix notation. |
| js/tests/visual/modal.html | Migrates navbar expand class to prefix notation. |
| js/tests/visual/dropdown.html | Migrates navbar expand + grid markup to prefix notation. |
| js/tests/integration/index.html | Migrates responsive display utilities to prefix notation. |
| .stylelintrc.json | Updates selector class pattern to allow optional breakpoint prefix segments. |
| .bundlewatch.config.json | Raises CSS bundle size thresholds to account for expanded output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
louismaximepiton
left a comment
There was a problem hiding this comment.
I think it's missing some changes in some files:
*.spec.js(searched for-lg, -md, in collapse and offcanvas, dropdown)*.ts(searched for-lg, -md, -2xl, in component-details)*.js(searched for-lg, -md, intac.js).gx-sm->.gx-smallin examples/grid/index.astro.mt-xl->.mt-xlargein getting-strated/javascript.mdxps-xl->ps-xlargein migration-from-boosted/mdx
.border-lg-start haven't been renamed (docs only)
.offcanvas-lg haven't been renamed in sidebar.scss (docs only)
Wondering if we should rename:
placeholder-lg->placeholder-largeand all this kind of classescontainer-lg->lg:container
We'll need to be careful updating this PR with all the incoming files.
|
|
||
| @media print { | ||
| .font-size-print-large { | ||
| .print\:font-size-large { |
There was a problem hiding this comment.
We also change this kind of infix ?
There was a problem hiding this comment.
Seemed logical to me, also Bs6 did it too.
| } | ||
| } | ||
|
|
||
| // RFS rescaling |
There was a problem hiding this comment.
We can safely remove this section
There was a problem hiding this comment.
Yes, I wanted to wait for you PR #3504 to be merged for this
|
|
||
| - breakpoint: 3xl | ||
| abbr: -3xl | ||
| abbr: 3xl |
There was a problem hiding this comment.
Do we need breakpoint and abbr in this file ?
There was a problem hiding this comment.
I tried to remove them but it's way easier to create the documentation for flex and fload with it...
There was a problem hiding this comment.
| The first two examples show the scaled and fixed margin classes in action. The last one shows how to recreate an equivalent of `.mx-scaled-large` by combining other responsive margin classes. |
| @media (min-width: 1880px) { | ||
| .border-3xl { ... } | ||
| .border-3xl-none { ... } | ||
| .3xl\:border-none { ... } |
There was a problem hiding this comment.
Do we show these borders utilities .border-bkp ? Or they should be removed as the examples above ?
There was a problem hiding this comment.
Probably an error when updating
| { | ||
| "files": "**/*.scss", | ||
| "rules": { | ||
| "selector-class-pattern": [ |
There was a problem hiding this comment.
Did you have some examples that didn't work in the doc ?
There was a problem hiding this comment.
Not in the doc, but in the tests yes
|
|
||
| @return "#{css-escape-ident($name)}\\:"; | ||
| } | ||
| // END mod |
There was a problem hiding this comment.
Even wondering if we should continue to add these comments in our files
| // END mod | |
| // End mod |
| @@ -1,3 +1,6 @@ | |||
| @use "sass:list"; | |||
| @use "sass:string"; | |||
There was a problem hiding this comment.
I cannot remember why didn't use these rules before. I'm fine using them, just we have str-slice instead of string.slice, and str-index or index instead of list.index.
There was a problem hiding this comment.
I used them to use the code from bs6 directly as it does not have other consequence I think it's ok. I did not modify the rest of the file though to keep the modification small but we can do it.
| // Utility generator | ||
| // Used to generate utilities & print utilities | ||
| @mixin generate-utility($utility, $infix: "", $is-rfs-media-query: false) { | ||
| @mixin generate-utility($utility, $bkpt-prefix: "", $infix: "") { |
There was a problem hiding this comment.
| @mixin generate-utility($utility, $bkpt-prefix: "", $infix: "") { | |
| @mixin generate-utility($utility, $infix: "", $bkpt-prefix: "") { |
There was a problem hiding this comment.
Why do you suggest this? I put infix at the end because it will be removed at some point.
| // Utility generator | ||
| // Used to generate utilities & print utilities | ||
| @mixin generate-utility($utility, $infix: "", $is-rfs-media-query: false) { | ||
| @mixin generate-utility($utility, $bkpt-prefix: "", $infix: "") { |
There was a problem hiding this comment.
Yes, to generate responsive-bootstrap: true utilities see api.scss
Types of change
Related issues
Closes #3497
Context & Motivation
Be like Tailwind and Bs6
Description
Checklists
Checklist (for Core Team only)
Progression (for Core Team only)
ouds/mainfollowing conventional commitLive previews