8000 fix(Toolbar): Added hidden class to content element by tlabaj · Pull Request #6678 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

fix(Toolbar): Added hidden class to content element#6678

Merged
mcoker merged 3 commits intov6from
toolbar_fix
May 22, 2024
Merged

fix(Toolbar): Added hidden class to content element#6678
mcoker merged 3 commits intov6from
toolbar_fix

Conversation

@tlabaj
Copy link
Contributor
@tlabaj tlabaj commented May 21, 2024

closes: #6627

@tlabaj tlabaj requested a review from mcoker May 21, 2024 18:19
@patternfly-build
Copy link
Collaborator
patternfly-build commented May 21, 2024

@tlabaj tlabaj marked this pull request as ready for review May 21, 2024 21:12
Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment about what pf-v6-hidden-visible() does that hopefully clarifies a change needed to get this hooked up.

Also for the .history/* files showing up, that's the first I've seen of .history files making it into a PR but looks like it's in react's .gitignore, so feel free to add it to core's as part of this PR!


// - Toolbar content - Toolbar group - Toolbar item - Toolbar group label container - Toolbar group label group
// - Toolbar content - Toolbar content section - Toolbar group - Toolbar item - Toolbar group label container - Toolbar group label group
.#{$toolbar}__content,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pf-v6-hidden-visible() generates .pf-m-hidden and .pf-m-visible classes for selectors its used with, and takes an argument for the value of the display property used to show the selector(s) that is used with .pf-m-visible. Here's some fake code to show what I mean:

.pf-c-component,
.pf-c-another-component {
  @include pf-v6-hidden-visible(flex);
}

// compiles to this CSS
.pf-c-component.pf-m-hidden,
.pf-c-another-component.pf-m-hidden {
  display: none;
}

.pf-c-component.pf-m-visible,
.pf-c-another-component.pf-m-visible {
  display: flex; // "flex" is the argument passed to pf-v6-hidden-visible() above
}

All of the selectors in this block where .#{$toolbar}__content was added are flex layouts, so they can all be grouped this way. However, .#{$toolbar}__content is a grid layout, so it can't be used in this group. We can see that it is display: grid here

.#{$toolbar},
.#{$toolbar}__content {
position: relative;
display: grid;
}

So in short we just need to create a new block for .#{$toolbar}__content to use pf-v6-hidden-visible(). Something like

.#{$toolbar}__content {
  @include pf-v6-hidden-visible(grid);
}

Then remove the display: grid declaration on .#{$toolbar}__content here, since pf-v6-hidden-visible() will set it

But we'll want to make sure .#{$toolbar} is still set to display: grid; and both .#{$toolbar} and .#{$toolbar}__content are set to position: relative.

@kmcfaul kmcfaul linked an issue May 22, 2024 that may be closed by this pull request
Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small nit!

.#{$toolbar},
.#{$toolbar}__content {
position: relative;
display: grid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this removes display: grid; from .#{$toolbar}, too, we'll need to add that back. You can probably just add it as the first .#{$toolbar} style here

.#{$toolbar} {
width: var(--#{$toolbar}--Width, auto);

Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀

@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 6.0.0-alpha.137 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toolbar - hidden class not working on content element

3 participants

0