-
-
Notifications
You must be signed in to change notification settings - Fork 601
[6.x] Max width control for the CP (Expand/Constrain Layout) #13647
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
Open
JayGeorge
wants to merge
58
commits into
master
Choose a base branch
from
max-width-control
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+356
−263
Open
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
87c4553
Draft an alert component
JayGeorge 3be6edd
Fix icons
JayGeorge 0cfb821
Alert - improve markup
JayGeorge ef27349
Alert - tweak alignment
JayGeorge d9952d8
Alert - message styling
JayGeorge 136176a
Alert - Style code snippets
JayGeorge e571449
Alert / Style code snippets - remove unnecessary borders
JayGeorge 2fafc24
Alert / Style code snippets - fix dark mode legibility
JayGeorge 7b36101
Alert / Style code snippets - improve
JayGeorge 6987890
Dashboard demo
JayGeorge 573a8e8
Merge branch 'master' into alert-component
JayGeorge 8f69599
Move the demo to the playground
JayGeorge 46e755b
Improve realism of demo messages
JayGeorge 0f8e853
Add alert component to the test's expected exports list
JayGeorge 312826d
Add Alert to the package export file
JayGeorge fa29d92
Alert - make code size smaller
JayGeorge f5e79e3
Alert - add storybook component
JayGeorge 02739de
Add some rich content examples
JayGeorge 97c436c
Fix icon
JayGeorge 9d8b22e
Add docs
JayGeorge 6230291
Add instruction
JayGeorge 84be7e9
Simplify the Alert component to use Vue's slot fallback syntax
JayGeorge 9c8b80b
Alerts should work with the Heading and Description components
JayGeorge dd46b21
Add some demos
JayGeorge 37f1143
Tweak variations
JayGeorge 684c786
Merge branch 'master' into alert-component
JayGeorge 5f2ddb3
Finish documenting using Alerts with Heading/Description components
JayGeorge 127ffdc
heading prop and use heading/description components
jasonvarga 15544e7
Fix color inconsistencies
JayGeorge 52a474b
Fix color inconsistencies
JayGeorge c4dc1ae
Fix dark icon colors
JayGeorge f4cb913
Dark mode fix
JayGeorge cc09401
Fix inconsistency
JayGeorge 79c83d8
Merge branch 'master' into max-width-control
JayGeorge 6b6d16d
Try a new max-width
JayGeorge 5a4aff5
Replace all max-width-5xl with new max-width-page
JayGeorge 2fe6c1d
Max width toggle prototype
JayGeorge ce3595e
Make the icons match more
JayGeorge aa269b1
Hide the toggle width button for smaller screens; it's just noise and…
JayGeorge 9fae14f
Add a tooltip instead of a title
JayGeorge 1b0de16
Change phrasing
JayGeorge ad921d2
Improve phrasing
JayGeorge 6efac37
Improve phrasing
JayGeorge cd27d05
Merge branch 'master' into max-width-control
JayGeorge 563a147
Fix /cp/collections not responding to the layout toggle control
JayGeorge 388b0d3
Make the layout-width button pulse when it appears
jackmcdade d5d96e4
Reduce max-width-page slightly
JayGeorge 8e3f94d
Use a different approach - wip
JayGeorge 8cf5a1e
Revert "Use a different approach - wip"
JayGeorge b26c35f
Get this bad boy working
JayGeorge 03696cc
Add max-w-5xl (maybe?) around lots of things
JayGeorge 601e651
Switch to a data-attribute to better separate tailwind classes with c…
JayGeorge 618c242
Try a max width of 6xl for narrower pages
JayGeorge 3aa30c0
Tidy - Add a few comments
JayGeorge edd18d3
irrelevant
jasonvarga 1f2f79f
Tweak layout expand icon animation slightly
JayGeorge 12abadf
Tweak layout expand icon animation slightly
JayGeorge dc7eaf1
Dynamic max width… Only switch to max-w-6xl on larger screens. On sma…
JayGeorge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,22 @@ | ||
| import { ref, watch } from 'vue'; | ||
|
|
||
| const STORAGE_KEY = 'statamic.max-width-enabled'; | ||
| const isMaxWidthEnabled = ref( | ||
| localStorage.getItem(STORAGE_KEY) !== 'false' // Default to true | ||
| ); | ||
|
|
||
| // Sync with localStorage | ||
| watch(isMaxWidthEnabled, (value) => { | ||
| localStorage.setItem(STORAGE_KEY, value.toString()); | ||
| }); | ||
|
|
||
| export default function useMaxWidthToggle() { | ||
| const toggle = () => { | ||
| isMaxWidthEnabled.value = !isMaxWidthEnabled.value; | ||
| }; | ||
|
|
||
| return { | ||
| isMaxWidthEnabled, | ||
| toggle, | ||
| }; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Max-width toggle ineffective for pages with own wrappers
Medium Severity
The layout max-width toggle in
Layout.vueconditionally appliesmax-w-pagebased onisMaxWidthEnabled. However, most pages (likeaddons/Index.vue,blueprints/Edit.vue,forms/Index.vue, etc.) still have their own<div class="max-w-page mx-auto">wrappers. When the toggle is off (expanded layout), these inner wrappers still constrain the content to 90rem, making the toggle ineffective. Onlycollections/Index.vuehad its wrapper removed, so only that page actually responds to the toggle. Users clicking the toggle button will see no change on most pages.Additional Locations (2)
resources/js/pages/addons/Index.vue#L30-L31resources/js/pages/layout/Layout.vue#L40-L44