-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(grid): include padding in max-width and align with nav bar (#1120)
Relates to #867, #867 (comment) After a talk with @jannick-ux we came to the conclusion that: - width in Figma are meant to include the padding so if grid max width is 1440px, the actual component width is 1312px so in total: 1312px width + 2 * 64px padding = 1440px. What I did: - fix grid to use `box-sizing: border-box;` instead of `content-box` - add screenshot tests which shows a full app layout with nav bar and page content to test that both are aligned with each other - add grid demo page to the alpha demo app so we can play around with it and see it in action
- Loading branch information
1 parent
74c66bd
commit c011e27
Showing
25 changed files
with
143 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"sit-onyx": patch | ||
--- | ||
|
||
fix(grid): include padding in max-width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineStore } from "pinia"; | ||
import { ref } from "vue"; | ||
|
||
export const useGridStore = defineStore("grid", () => { | ||
const isMaxWidth = ref(false); | ||
const isCentered = ref(false); | ||
|
||
return { isMaxWidth, isCentered }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts" setup> | ||
import { OnyxPageLayout, OnyxSwitch } from "sit-onyx"; | ||
import { useGridStore } from "../stores/grid-store"; | ||
const gridStore = useGridStore(); | ||
</script> | ||
|
||
<template> | ||
<OnyxPageLayout> | ||
<div class="onyx-grid"> | ||
<OnyxSwitch | ||
v-model="gridStore.isMaxWidth" | ||
class="onyx-grid-span-3" | ||
label="Is max width (md)" | ||
/> | ||
<OnyxSwitch | ||
v-if="gridStore.isMaxWidth" | ||
v-model="gridStore.isCentered" | ||
class="onyx-grid-span-3" | ||
label="Is centered" | ||
/> | ||
|
||
<p class="content onyx-grid-span-16">Page content</p> | ||
</div> | ||
</OnyxPageLayout> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.content { | ||
background-color: var(--onyx-color-base-info-200); | ||
color: var(--onyx-color-text-icons-info-bold); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-21.7 KB
...s/components/OnyxNavBar/Navigation-bar-lg-grid-max-width-md--chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-33.1 KB
...ts/components/OnyxNavBar/Navigation-bar-lg-grid-max-width-md--firefox-linux.png
Binary file not shown.
Binary file removed
BIN
-19.4 KB
...ots/components/OnyxNavBar/Navigation-bar-lg-grid-max-width-md--webkit-linux.png
Binary file not shown.
Binary file added
BIN
+10.2 KB
...onyx/playwright/snapshots/components/OnyxNavBar/grid-default-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.9 KB
...-onyx/playwright/snapshots/components/OnyxNavBar/grid-default-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.75 KB
...t-onyx/playwright/snapshots/components/OnyxNavBar/grid-default-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...x/playwright/snapshots/components/OnyxNavBar/grid-max-center-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.1 KB
...yx/playwright/snapshots/components/OnyxNavBar/grid-max-center-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.74 KB
...nyx/playwright/snapshots/components/OnyxNavBar/grid-max-center-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...yx/playwright/snapshots/components/OnyxNavBar/grid-max-width-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.8 KB
...nyx/playwright/snapshots/components/OnyxNavBar/grid-max-width-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.77 KB
...onyx/playwright/snapshots/components/OnyxNavBar/grid-max-width-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.