-
Notifications
You must be signed in to change notification settings - Fork 376
feat(toolbar): implement container query option #12174
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(npm run lint)", | ||
| "Bash(npm run lint:*)" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ export interface ToolbarContextProps { | |
| showClearFiltersButton?: boolean; | ||
| toolbarId?: string; | ||
| customLabelGroupContent?: React.ReactNode; | ||
| useContainerQuery?: boolean; | ||
| } | ||
|
|
||
| export const ToolbarContext = createContext<ToolbarContextProps>({ | ||
|
|
@@ -23,7 +24,8 @@ export const ToolbarContext = createContext<ToolbarContextProps>({ | |
| labelGroupContentRef: null, | ||
| updateNumberFilters: () => {}, | ||
| numberOfFilters: 0, | ||
| clearAllFilters: () => {} | ||
| clearAllFilters: () => {}, | ||
| useContainerQuery: false | ||
| }); | ||
|
|
||
| interface ToolbarContentContextProps { | ||
|
|
@@ -49,3 +51,12 @@ export const globalBreakpoints = { | |
| xl: parseInt(globalBreakpointXl.value) * 16, | ||
| '2xl': parseInt(globalBreakpoint2xl.value) * 16 | ||
| }; | ||
|
|
||
| // Container query breakpoints match CSS container query values | ||
| export const containerBreakpoints = { | ||
| sm: 286, | ||
| md: 478, | ||
| lg: 702, | ||
| xl: 992, // You may need to verify this value | ||
| '2xl': 1200 // You may need to verify this value | ||
| }; | ||
|
Comment on lines
+55
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: PatternFly’s standard breakpoint sizes (exposed as CSS variables) are:
You can use those values in container queries (or media/container-query CSS) directly or via the PatternFly CSS custom properties. Example usages:
Sources: PatternFly development guidelines (breakpoint values) and PatternFly global CSS variables. [1][2] References 🏁 Script executed: # Search for references to containerBreakpoints and context about these values
rg "containerBreakpoints|container.*breakpoint" packages/react-core/src/components/Toolbar/ -A 3 -B 3
# Also check if there are comments or documentation explaining the choice
rg "286|478|702" packages/ -B 2 -A 2
# Search for any related issue references or PR descriptions
rg "8025|container.*query" packages/react-core/src/components/Toolbar/ -B 2 -A 2Repository: patternfly/patternfly-react Length of output: 50384 🏁 Script executed: # Search for CSS container query definitions or related documentation
fd -e css -e scss | xargs rg -l "container.*query|@container" 2>/dev/null | head -10
# Look for any tests or examples that might validate these breakpoint values
fd -e test.tsx -e spec.tsx | xargs rg "containerBreakpoints|286|478|702" 2>/dev/null | head -20
# Check if there's any documentation about these values
fd -e md | xargs rg "container.*breakpoint|286|478|702" 2>/dev/nullRepository: patternfly/patternfly-react Length of output: 21022 Remove unverified comments from hardcoded breakpoint values or verify them against the CSS container query definitions. The hardcoded 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| .ws-react-c-toolbar-resize-container { | ||
| resize: horizontal; | ||
| overflow: auto; | ||
| border: var(--pf-t--global--border--width--extra-strong) dashed var(--pf-t--global--border--color--default); | ||
| /* padding: var(--pf-t--global--spacer--md); */ | ||
| width: 800px; | ||
| min-width: 300px; | ||
| max-width: 100%; | ||
| height: 15em; | ||
| } | ||
|
|
||
|
Comment on lines
+1
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consolidate duplicate CSS files. This file is identical to
🤖 Prompt for AI Agents |
||
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.
Build failure: CSS modifier classes don't exist yet.
The TypeScript build fails because
styles.modifiers.container,styles.modifiers.containerSm, etc. don't exist in the current@patternfly/react-stylespackage. This PR depends on patternfly/patternfly#8025 for these CSS classes.Consider one of:
Note: The above is a workaround. The proper fix is to coordinate with the core PatternFly release.
📝 Committable suggestion
🧰 Tools
🪛 GitHub Actions: Documentation
[error] 225-225: TS2339: Property 'container' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
🪛 GitHub Check: Build, test & deploy
[failure] 234-234:
Property 'containerXl' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
[failure] 233-233:
Property 'containerLg' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
[failure] 232-232:
Property 'containerMd' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
[failure] 231-231:
Property 'containerSm' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
[failure] 230-230:
Property 'container_2xl' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
[failure] 225-225:
Property 'container' does not exist on type '{ hidden: "pf-m-hidden"; hiddenOnSm: "pf-m-hidden-on-sm"; visibleOnSm: "pf-m-visible-on-sm"; hiddenOnMd: "pf-m-hidden-on-md"; visibleOnMd: "pf-m-visible-on-md"; hiddenOnLg: "pf-m-hidden-on-lg"; ... 346 more ...; hideOn_2xl: "pf-m-hide-on-2xl"; }'.
🤖 Prompt for AI Agents