-
Notifications
You must be signed in to change notification settings - Fork 9
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
Use %placeholder and @extend on button mixins to see if it makes code less repetitive #347
Conversation
Notes: If we don't use the button mixin in other components, e.g., links, CTA and cards, we can get away with not doing |
|
||
%button-base { |
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.
I like where you are going for this. I vote for moving this to its own file and documenting it like we do mixins. Perhaps we need to create a /core/scss/utilties/placeholders/
directory?
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.
Yeah, I think that makes sense - do you think it's better to add a directory for each component that has placeholders or just all in the root /placeholders?
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.
Directories are good. We will likely get to a point where we will want them so let's start with them.
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.
@sherakama , I just pushed up a commit. I created /placeholder
inside /utilities
. I'm using the same structure as /variables
by creating a /components
inside /placeholders
and moved the button placeholder style there. What do you think? Since we're most likely to have only 1 placeholder for each component, I didn't create a separate /button
inside /components
.
TL;DR - we now have
/utilities/placeholders
/utilities/placeholders/components/_button.scss (where new %button-base is)
What do you think?
…here under /components subdirectory
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.
I made one more big change to this. I moved the CTA mixin to a placeholder as I feel that makes more sense than a mixin. I would say we would want to avoid complex components as mixins.
Yeah, I think this change makes sense. I noticed that the CTA buttons aren't working right now but I'm assuming you're working on it (says fixup wip in your commit message) so I won't touch it for now. Thanks for the tweak! |
Thank you two for you discussion and work on this ticket. Structure and strategy sound and look solid. One thing that we might want to address before merging this is: For the CTA component: The button style is not taking. It reads "Button Text" but it is not a button. Also, for the |
The button not working on CTAs appears to be an order of operations issue:
|
@josephgknox ...interesting....you found a paradox!! 😂 |
@yvonnetangsu Haha! Yep, the |
@yvonnetangsu I also see you comment to Shea regarding the same/similar thing. Do we want to proceed with merging in this work, knowing that we will need to clean up the CTA buttons later? |
Hehe..maybe this makes a case for keeping my original approach of @CTA as mixin 😄 ! Just joking - I don't think @sherakama likes this approach 🤔 @josephgknox , That's ok, I'm totally fine with this not merged in before we know that everything's working. It was sort of an experiment for discussion on Zoom meeting tomorrow anyway. So everything is open for improvement/tweaks. |
@yvonnetangsu sounds good! More tomorrow. :) |
Sorry about the rollup mix up. I fixed the extends typo and included the cta appropriately. Pros for this approach:
Cons for this approach:
Let's talk more about this tomorrow. |
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.
G2G!
* master: Use %placeholder and @extend on button mixins to see if it makes code less repetitive (#347) Cut down on media queries generated by @modular-spacing (#343) Main Nav Light on Dark Background Color Variant (#344) Reorganize files for CTA so it's consistent with other components (#345) Update main-nav.twig (#331) get rid of ID (#342) 5 Lines Lockup + Variants (#289) Update _alert--info.scss (#330) # Conflicts: # core/css/decanter.css # core/scss/utilities/mixins/button/_button-big.scss # core/scss/utilities/mixins/button/_button-primary.scss # core/scss/utilities/mixins/button/_button-secondary.scss # core/scss/utilities/mixins/index.scss
READY FOR REVIEW
Summary
%button-base
class with the button base styles that are mostly common to all button variants, and also used by some more complex components such as the CTA (uses the.su-button--big
variant).%button-base
class in the variants' mixins and see if it reduces our output CSS file size and scss file size.Needed By (Date)
Urgency
Steps to Test
grunt styleguide
Affected Projects or Products
Associated Issues and/or People