FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(accordion): add no-box-shadow variation, refactor expanded border by mcoker · Pull Request #2385 · patternfly/patternfly · GitHub

fix(accordion): add no-box-shadow variation, refactor expanded border - #2385

Merged
mattnolting merged 4 commits into
patternfly:masterfrom
mcoker:issue-2376-2375
Oct 24, 2019
Merged

fix(accordion): add no-box-shadow variation, refactor expanded border#2385
mattnolting merged 4 commits into
patternfly:masterfrom
mcoker:issue-2376-2375

Conversation

mcoker commented Oct 22, 2019

Copy link
Copy Markdown
Contributor

fixes #2376

fixes #2375

Copy link
Copy Markdown
Collaborator

PatternFly-Next preview: https://patternfly-next-pr-2385.surge.sh

@@ -4,7 +4,6 @@
.pf-c-accordion {
// accordion
--pf-c-accordion--BackgroundColor: var(--pf-global--BackgroundColor--100);
--pf-c-accordion--BorderWidth: var(--pf-global--BorderWidth--sm);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

are you making this PR a breaking change? or is this considered a bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This var isn't used anywhere in the component, so it's safe to remove.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can add it back and create a follow up issue to remove it in a breaking change release if you can think of a use case where removing it would break someone's design.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not sure if I can think of a use case of it breaking someones design, but to be safe I think we've been following that method right? @mcoker

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we did leave it one place before in a similar scenario. I think the use case would be if someone had written their own CSS that used --pf-c-accordion--BorderWidth, removing the var would break what they're doing. I'll leave it and leave a comment to remove it at a breaking change release just to be sure.

padding: var(--pf-c-accordion__toggle--PaddingTop) var(--pf-c-accordion__toggle--PaddingRight) var(--pf-c-accordion__toggle--PaddingBottom) var(--pf-c-accordion__toggle--PaddingLeft);
border: 0;
border-left: var(--pf-c-accordion__toggle--m-expanded--BorderWidth) solid var(--pf-c-accordion__toggle--BorderLeftColor);
&.pf-m-no-box-shadow {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would you call this pf-m-plain since this modifier basically removes any border/shadow/line around the accordion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We could call it something else, but it's just removing the box-shadow at the moment. I don't know if there is anything else we plan on offering in a variation of the accordion without a box shadow.

@mcarrano what do you think, should we give this variation (no box shadow) a more meaningful name? You had also mentioned that you weren't sure why the accordion had a box shadow to begin with. One thing we could do (in a breaking change release) is remove the box shadow from the accordion entirely, and if you want a box shadow, you place it in a card. Though it's worth noting the default box shadow on the accordion is --pf-global--BoxShadow--md, and the box shadow on the card is --pf-global--BoxShadow--sm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't really have a good answer @mcoker . @mceledonia do you know why we put a box shadow around the accordion? I agree that without the shadow, the accordion could be placed in a card to get this effect.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I believe the accordion had the shadow as a stylistic effect for a particular use case where it existed above other content similar to a popover.

As for using a card to achieve the same effect, the default card shadow is quite different than the one I see on the accordion (the card's shadow is smaller/tighter), so I would say as long as the card is flexible enough to utilize whatever type of shadow is needed, that should work.

It makes sense to offer a version without the shadow for usage within a broader context, Kyle worked on this and is out for a while so I will investigate further as I believe this was in collaboration with the digital design team.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Though it's worth noting the default box shadow on the accordion is --pf-global--BoxShadow--md, and the box shadow on the card is --pf-global--BoxShadow--sm.

Woops, missed that! Yeah we would want to be sure we cover that as I have a feeling the box shadow was added to cover a use case where this existed above other content, but I can't say for sure. Going to investigate that like I said - but I think offering a modifier to remove it makes sense.

As for naming, I expect this non-shadow version to be used in a larger context like a form or some kind of content layout. I expect the shadow version to be used more or less on it's own, possibly as a result of an action to trigger it to appear. Maybe that can give some ideas on what to name it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sorry for the rapid response, but I am thinking if you need the larger shadow for this, you might be able to utilize a popover to get the same effect. Card would potentially work as well like you previously mentioned. In that case, we could remove that shadow altogether.

Copy link
Copy Markdown
Member

@mcoker I'm seeing this, are you as well?

mcoker commented Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

@christiemolloy yep! Updated.

mcoker commented Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

Also created #2388 to clean up these var names.

christiemolloy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

perfect

mattnolting left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Vars that aren't being used:

  • --pf-c-accordion--BorderWidth
  • --pf-c-accordion__toggle-text--hover--FontWeight
  • --pf-c-accordion__toggle-text--active--FontWeight
  • --pf-c-accordion__toggle-text--focus--Color

Should the items inside .pf-c-accordion__toggle move to root?


max-width: var(--pf-c-accordion__toggle-text--MaxWidth);
}
.pf-c-accordion__toggle-text {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should this move out of __toggle?


&.pf-m-expanded {
--pf-c-accordion__toggle--BorderLeftColor: var(--pf-c-accordion__toggle--m-expanded--BorderLeftColor);
.pf-c-accordion__toggle-icon {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same here, should it move out of __toggle?

mcoker commented Oct 24, 2019

Copy link
Copy Markdown
Contributor Author

@mattnolting I'm seeing these in use still

marvin:patternfly-next cmichael$ grep -ri 'pf-c-accordion__toggle-text--active--FontWeight\|pf-c-accordion__toggle-text--focus--Color' src/patternfly/
src/patternfly//components/Accordion/accordion.scss:  --pf-c-accordion__toggle-text--active--FontWeight: var(--pf-global--FontWeight--semi-bold);
src/patternfly//components/Accordion/accordion.scss:  --pf-c-accordion__toggle-text--focus--Color: var(--pf-global--link--Color);
src/patternfly//components/Accordion/accordion.scss:      font-weight: var(--pf-c-accordion__toggle-text--active--FontWeight);
src/patternfly//components/Accordion/accordion.scss:      color: var(--pf-c-accordion__toggle-text--focus--Color);

Let me know if you still think they need to be removed. Added the other vars to #2388 so we can remove them in a breaking change release.

mattnolting left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Perfect 💯

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.39.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

mcoker deleted the issue-2376-2375 branch December 16, 2019 22:53
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL