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

[OUDS] Add "Grid" tokens, utilities, examples and documentation #2744

Merged
merged 38 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fcdf512
Add new OUDS tokens, restore layout pages, restore grid example
hannahiss Sep 26, 2024
26a91a2
Small shift of semantic.
louismaximepiton Oct 22, 2024
999d2ee
Add tests for grid classes.
louismaximepiton Oct 22, 2024
741fef4
Api changes
louismaximepiton Oct 23, 2024
54fe74a
Update scss/_functions.scss
julien-deramond Oct 23, 2024
eaae211
Change comments in grid-system/index.html
julien-deramond Oct 23, 2024
cf54cd5
Drop unused Bootstrap containers from grid example
julien-deramond Oct 23, 2024
070e6bb
Rename container max-width Scss var + enhance documentation
julien-deramond Oct 23, 2024
fbf01bc
Update migration guide
julien-deramond Oct 23, 2024
fa2aa24
Enhance OUDS Web grid system example
julien-deramond Oct 23, 2024
a96005b
Enhance OUDS Web grid system example
julien-deramond Oct 23, 2024
fceeef7
Fix docs compilation
julien-deramond Oct 23, 2024
95145af
Use mobile demo app colors
julien-deramond Oct 23, 2024
eea650b
Fix sentence in Grid example
julien-deramond Oct 23, 2024
cb1f0dd
Fixes in `breakpoints.scss`
julien-deramond Oct 23, 2024
4f10224
Formatting in `scss/ouds-web.scss`
julien-deramond Oct 23, 2024
4799102
Typo
julien-deramond Oct 23, 2024
6077154
Update `.container` and other stuff
julien-deramond Oct 23, 2024
2ea999e
Change examples' images
louismaximepiton Oct 23, 2024
2b593f2
Bring small tweaks to the CSS
louismaximepiton Oct 23, 2024
6b087f5
Some fixes
julien-deramond Oct 23, 2024
f77f34d
Minor modification in Breakpoint md
julien-deramond Oct 23, 2024
b4475ba
Fix CSS tests
louismaximepiton Oct 23, 2024
757038c
Add modifiy utilities section in Utility API
julien-deramond Oct 23, 2024
3897937
Add 'Remove utilities' section in Utility API
julien-deramond Oct 23, 2024
72d8f83
Fix layout/column.md
julien-deramond Oct 24, 2024
d1ebd2f
Improve layout/containers.md
julien-deramond Oct 24, 2024
f799602
Fix OUDS mod comments in `scss/_containers.scss`
julien-deramond Oct 24, 2024
cc3a911
Fix OUDS mod comments in some Sass files
julien-deramond Oct 24, 2024
1684e6c
Enhance migration guides
julien-deramond Oct 24, 2024
b52e2e7
Fix docs compilation
julien-deramond Oct 24, 2024
3ef6890
Change the `.container-*` behavior in the docs
louismaximepiton Oct 24, 2024
404d28d
Missing OUDS mod
louismaximepiton Oct 24, 2024
720c0d2
Change fusv approach
julien-deramond Oct 24, 2024
481f449
Fix typos
louismaximepiton Oct 24, 2024
ff47620
.
louismaximepiton Oct 24, 2024
394082a
Update to use the new semantic token (renamed)
julien-deramond Oct 24, 2024
132b455
.
julien-deramond Oct 24, 2024
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
16 changes: 8 additions & 8 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"files": [
{
"path": "./dist/css/ouds-web-bootstrap.css",
"maxSize": "45.25 kB"
"maxSize": "51.0 kB"
},
{
"path": "./dist/css/ouds-web-bootstrap.min.css",
"maxSize": "42.0 kB"
"maxSize": "47.75 kB"
},
{
"path": "./dist/css/ouds-web-grid.css",
"maxSize": "7.0 kB"
"maxSize": "9.5 kB"
},
{
"path": "./dist/css/ouds-web-grid.min.css",
"maxSize": "6.25 kB"
"maxSize": "8.5 kB"
},
{
"path": "./dist/css/ouds-web-reboot.css",
Expand All @@ -26,19 +26,19 @@
},
{
"path": "./dist/css/ouds-web-utilities.css",
"maxSize": "13.0 kB"
"maxSize": "14.25 kB"
},
{
"path": "./dist/css/ouds-web-utilities.min.css",
"maxSize": "12.0 kB"
"maxSize": "13.5 kB"
},
{
"path": "./dist/css/ouds-web.css",
"maxSize": "44.75 kB"
"maxSize": "49.0 kB"
},
{
"path": "./dist/css/ouds-web.min.css",
"maxSize": "41.75 kB"
"maxSize": "45.5 kB"
},
{
"path": "./dist/js/ouds-web.bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion js/tests/integration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<title>Hello, world!</title>
</head>
<body>
<div class="container py-4">
<div class="container-fluid py-4">
<h1>Hello, world!</h1>

<div class="mt-5">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/unit/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ describe('Dropdown', () => {
it('should open the dropdown when clicking the child element inside `data-bs-toggle="dropdown"`', () => {
return new Promise(resolve => {
fixtureEl.innerHTML = [
'<div class="container">',
'<div class="container-fluid">',
' <div class="dropdown">',
' <button class="btn dropdown-toggle" data-bs-toggle="dropdown"><span id="childElement">Dropdown</span></button>',
' <div class="dropdown-menu">',
Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/scrollspy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe('ScrollSpy', () => {
'<div id="root" class="active" style="display: block">',
' <div class="topbar">',
' <div class="topbar-inner">',
' <div class="container" id="ss-target">',
' <div class="container-fluid" id="ss-target">',
' <ul class="nav">',
' <li class="nav-item"><a href="#masthead">Overview</a></li>',
' <li class="nav-item"><a href="#detail">Detail</a></li>',
Expand Down Expand Up @@ -300,7 +300,7 @@ describe('ScrollSpy', () => {
'<div id="root" class="active" style="display: block">',
' <div class="topbar">',
' <div class="topbar-inner">',
' <div class="container" id="ss-target">',
' <div class="container-fluid" id="ss-target">',
' <ul class="nav">',
' <li class="nav-item"><a href="#masthead">Overview</a></li>',
' <li class="nav-item"><a href="#detail">Detail</a></li>',
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/alert.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Alert</title>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Alert <small>Bootstrap Visual Test</small></h1>

<div class="alert alert-warning alert-dismissible fade show" role="alert">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Button</title>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Button <small>Bootstrap Visual Test</small></h1>

<button type="button" class="btn btn-primary" data-bs-toggle="button" aria-pressed="false" autocomplete="off">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Carousel <small>Bootstrap Visual Test</small></h1>

<p>The transition duration should be around 2s. Also, the carousel shouldn't slide when its window/tab is hidden. Check the console log.</p>
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Collapse</title>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Collapse <small>Bootstrap Visual Test</small></h1>

<div id="accordion" role="tablist">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Dropdown</title>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Dropdown <small>Bootstrap Visual Test</small></h1>

<nav class="navbar navbar-expand-md bg-light">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<style></style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Input <small>Bootstrap Visual Test</small></h1>

<h2>No layout</h2>
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>
</nav>

<div class="container mt-3">
<div class="container-fluid mt-3">
<h1>Modal <small>Bootstrap Visual Test</small></h1>

<div class="modal fade" id="myModal" tabindex="-1" aria-labelledby="myModalLabel" aria-hidden="true">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Popover</title>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Popover <small>Bootstrap Visual Test</small></h1>

<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="auto" data-bs-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/scrollspy.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</ul>
</div>
</nav>
<div class="container">
<div class="container-fluid">
<h2 id="fat">@fat</h2>
<p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
<p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Tab <small>Bootstrap Visual Test</small></h1>

<h4>Tabs without fade</h4>
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/toast.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Toast <small>Bootstrap Visual Test</small></h1>

<div class="row mt-3">
Expand Down
2 changes: 1 addition & 1 deletion js/tests/visual/tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<h1>Tooltip <small>OUDS Web Visual Test</small></h1>

<p class="text-body-secondary">Tight pants next level keffiyeh <a href="#" data-bs-toggle="tooltip" title="Default tooltip">you probably</a> haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel <a href="#" data-bs-toggle="tooltip" title="Another tooltip">have a</a> terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan <a href="#" data-bs-toggle="tooltip" title="Another one here too">whatever keytar</a>, scenester farm-to-table banksy Austin <a href="#" data-bs-toggle="tooltip" title="The last tip!">twitter handle</a> freegan cred raw denim single-origin coffee viral.</p>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"css-rtl": "cross-env NODE_ENV=RTL postcss --config build/postcss.config.mjs --dir \"dist/css\" --ext \".rtl.css\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*.rtl.css\"",
"css-lint": "npm-run-all --aggregate-output --continue-on-error --parallel css-lint-*",
"css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --cache --cache-location .cache/.stylelintcache",
"css-lint-vars": "fusv scss/ site/assets/scss/ --ignoreFiles '**/tokens/*.scss'",
"css-lint-vars": "fusv scss/ site/assets/scss/ --ignoreFiles **/tokens/_component.scss,**/tokens/_raw.scss,**/tokens/_semantic.scss",
"css-minify": "npm-run-all --aggregate-output --parallel css-minify-*",
"css-minify-main": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*rtl*.css\"",
"css-minify-rtl": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*rtl.css\" \"!dist/css/*.min.css\"",
Expand Down
75 changes: 50 additions & 25 deletions scss/_containers.scss
louismaximepiton marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,70 @@
// Set the container width, and override it for fixed navbars in media queries.

@if $enable-container-classes {
// Single container class with breakpoint max-widths
.container,
// OUDS mod: `.container` selector is conditionally handle whenever `$enable-bootstrap-compatibility` is true
// 100% wide container at all breakpoints
.container-fluid {
@include make-container();
}

// OUDS mod: `.container-fluid` is not full width in OUDS Web
.container-fluid {
@include make-container-fluid-margin();
}
// End mod

// Responsive containers that are 100% wide until a breakpoint
@each $breakpoint, $container-max-width in $container-max-widths {
.container-#{$breakpoint} {
@extend .container-fluid;
@if $enable-bootstrap-compatibility { // OUDS mod
// OUDS mod
// Single container class with breakpoint max-widths
.container {
@include make-container();
}
// End mod

@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
%responsive-container-#{$breakpoint} {
max-width: $container-max-width;
// Responsive containers that are 100% wide until a breakpoint
@each $breakpoint, $container-max-width in $container-max-widths {
// OUDS mod: link 2xl breakpoint to xxl
@if $breakpoint == 2xl {
.container-xxl {
@extend .container-fluid;
}
}
// End mod

// Extend each breakpoint which is smaller or equal to the current breakpoint
$extend-breakpoint: true;
.container-#{$breakpoint} {
@extend .container-fluid;
}

@each $name, $width in $grid-breakpoints {
@if ($extend-breakpoint) {
.container#{breakpoint-infix($name, $grid-breakpoints)} {
@extend %responsive-container-#{$breakpoint};
}
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
%responsive-container-#{$breakpoint} {
max-width: $container-max-width;
}

// Once the current breakpoint is reached, stop extending
@if ($breakpoint == $name) {
$extend-breakpoint: false;
// Extend each breakpoint which is smaller or equal to the current breakpoint
$extend-breakpoint: true;

@each $name, $width in $grid-breakpoints {
@if ($extend-breakpoint) {
.container#{breakpoint-infix($name, $grid-breakpoints)} {
@extend %responsive-container-#{$breakpoint};
}

// Once the current breakpoint is reached, stop extending
@if ($breakpoint == $name) {
$extend-breakpoint: false;
}
}
}
}
}
}

hannahiss marked this conversation as resolved.
Show resolved Hide resolved
// OUDS mod
// scss-docs-start containers-max
.container-max-width {
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
@include media-breakpoint-up(get-breakpoint-from-width()) {
--#{$prefix}container-margin-x: #{map-get($container-fluid-margin, get-breakpoint-from-width())};
max-width: $ouds-size-max-width-grid-grid;

.row {
--#{$prefix}gutter-x: #{map-get($grid-gutter-widths, get-breakpoint-from-width())};
}
}
}
// scss-docs-end containers-max
// End mod
}
2 changes: 1 addition & 1 deletion scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Do nothing
} @else if not comparable($prev-num, $num) {
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
} @else if $prev-num >= $num {
} @else if $prev-num > $num { // OUDS mod: ascending order can be equal
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
}
$prev-key: $key;
Expand Down
37 changes: 36 additions & 1 deletion scss/_maps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,41 @@ $utilities-links-underline: map-loop($utilities-colors, rgba-css-var, "$key", "l

$negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default;

$gutters: $spacers !default;
// OUDS mod
// scss-docs-start grid-gutters
$grid-gutter-widths: (
2xs: $ouds-grid-2xs-column-gap, // 8px
xs: $ouds-grid-xs-column-gap, // 16px
sm: $ouds-grid-sm-column-gap, // 16px
md: $ouds-grid-md-column-gap, // 24px
lg: $ouds-grid-lg-column-gap, // 24px
xl: $ouds-grid-xl-column-gap, // 32px
2xl: $ouds-grid-2xl-column-gap, // 32px
3xl: $ouds-grid-3xl-column-gap // 40px
) !default;
// scss-docs-end grid-gutters

// scss-docs-start gutters
$gutters: (
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
none: 0,
smash: 2px,
shortest: 4px,
shorter: 8px,
short: 12px,
medium: 16px,
tall: 24px,
taller: 32px,
tallest: 40px,
spacious: 48px,
huge: 56px,
jumbo: 64px
) !default;
// scss-docs-end gutters

@if $enable-bootstrap-compatibility {
// Add Bootstrap gutters
$gutters: map-merge($gutters, $spacers);
}
// End mod

$alert-colors: map-remove($theme-colors, "primary", "secondary", "light", "dark") !default; // OUDS mod
Loading
Loading