-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Style icons with CSS #2272
Style icons with CSS #2272
Conversation
|
composes: root from '../Icon/icon.css'; | ||
} | ||
|
||
.icon--filled { |
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.
So instead of passing a color prop, if you want to override the filled color you would provide your own icon--filled
class, right?
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.
A few comments regarding propTypes but otherwise this looks good. Shouldn't be anything major that would hold this up though.
CartTrigger.propTypes = { | ||
iconColor: string, | ||
classes: shape({ | ||
root: string |
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.
Can you add any missing classes? This is our only documentation of the change.
attrs: shape({}), | ||
classes: shape({ | ||
'icon--empty': string, | ||
'icon--filled': string, |
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 don't think this is accurate - we aren't passing icon--empty
or icon--filled
with classes
. We apply one or the other to the Icon
itself via className
. It just happens to get spread onto the Icon through restProps
.
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.
Oh, I see what I did. I put the new classnames in the prop types for Icon
rather than CartTrigger
. I'll fix that.
As for className
as a prop, you're right. The classify
HOC allowed us to pass className
as a shortcut override for classes.root
, but its mergeClasses
utility is simpler and doesn't have that feature. I'll update CartTrigger
to override classes.root
more explicitly.
@jimbo Pls take a look on following observations , PR (left) vs develop (Right) |
Fixed both. Kebab icons are now slightly larger; stepper icons are now slightly smaller.
Fixed both. The synthetic checkboxes now use raw feather icons with a new appearance.
Prefer the new unfilled style, so this is fine.
Fixed. Checkmark now uses raw feather icons with a new appearance. |
@jimbo Fixes looks good but problem with paginations icons issue is, they don't get disabled when user is first or last page. |
Good catch. Fixed. Also fixed the style of those buttons to be properly square and a bit larger (32x32). |
UI looks good on Chrome, Safari, firefox, android chrome. Good to merge once latest commits are reviewed. |
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.
Just need clarification on a redundant class, otherwise these changes look good 👍
composes: buttonArrow; | ||
color: #999; | ||
.root_disabled { | ||
composes: root; |
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.
This class seems a bit redundant. Did you intend to add additional styles, or should this instead just be:
.root:disabled {
pointer-events: none;
}
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.
Fair point. I had included it as an optional classname to mirror the one for the icon, but the pseudo is probably sufficient for the root itself.
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.
While I was fixing this, I noticed a few more bits of weird CSS in the pagination styles. These have been fixed. Please check those out too. @tjwiebell
Description
Style the
Icon
component with CSS rather than SVG attributes.Related Issue
PWA-445
Acceptance
Verification Stakeholders
Specification
Verification Steps
Screenshots / Screen Captures (if appropriate)
Checklist