feat(lib): migrate breakpoints from infix to prefix#3499
feat(lib): migrate breakpoints from infix to prefix#3499MaxLardenois wants to merge 23 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.
| @@ -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.
There was a problem hiding this comment.
I think it was for the node:sass we supported, back in the days. Keeping it open for now to think to create an issue about that
There was a problem hiding this comment.
I think we can keep that for a possible Sass module migration in the future but I'm open
| // 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.
There was a problem hiding this comment.
Yeah it was to avoid breaking this function for people, I don't know which one is best. Keep it open for other reviews.
There was a problem hiding this comment.
Good point, it's probably not used but I can switch
Done, thanks
Done, even if it's not related to this PR
Both removed as OUDS mod as they are not used
We could, not this PR concern though, let's discuss elsewhere if you want
This is boostrap compat only so we should not rename
It's a big one yes |
louismaximepiton
left a comment
There was a problem hiding this comment.
Waiting to see migrations, but t looks good to me.
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