-
Notifications
You must be signed in to change notification settings - Fork 39
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
.iui-field
handles icon fill
#2088
Conversation
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 am a bit confused about the purpose of this PR. The conversation that this PR is in response to seems to be about adding the icon fill logic into the field file, but this PR only adds a few variables to that file, and leaves all of the logic setting icon fill in the button and select files. Is this what we want?
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.
Adding to @Ben-Pusey-Bentley's comment, this PR looks half-baked. iui-field
needs to handle the actual icon fill, most importantly the fact that it changes between default, :hover
, and disabled
states.
Would it be acceptable to add an |
@FlyersPh9 I don't like the idea of a For this PR, it might be simpler to set the .iui-field {
// …
fill: var(--_iui-field-state--default, var(--_iui-field-color-icon))
var(--_iui-field-state--hover, var(--_iui-field-color-icon-hover))
var(--_iui-field-state--disabled, var(--_iui-field-color-icon-disabled));
} .iui-button-icon svg {
fill: inherit;
} |
.iui-button[data-iui-variant='borderless'] { | ||
border-radius: var(--iui-border-radius-round); | ||
|
||
> .iui-button-icon { | ||
filter: drop-shadow(0 2px 1px rgba(0, 0, 0, var(--iui-opacity-5))); | ||
} | ||
.iui-tile-thumbnail-picture ~ & { | ||
@include mixins.iui-blur($opacity: 5); | ||
--_iui-field-color-icon: var(--iui-color-white); | ||
--_iui-field-color-icon-hover: var(--iui-color-white); | ||
|
||
> .iui-button-icon { | ||
filter: drop-shadow(0 2px 1px rgba(0, 0, 0, var(--iui-opacity-5))); | ||
} | ||
|
||
&:hover, | ||
&[data-iui-active='true']:enabled, | ||
&[data-iui-active='true']:enabled:hover, | ||
&[data-iui-active='true']:active { | ||
background-color: rgba(0, 0, 0, var(--iui-opacity-4)); | ||
&:hover, | ||
&[data-iui-active='true']:enabled, | ||
&[data-iui-active='true']:enabled:hover, | ||
&[data-iui-active='true']:active { | ||
background-color: rgba(0, 0, 0, var(--iui-opacity-4)); | ||
} |
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.
Tile was failing React tests. Looked into it and our CSS demo's HTML structure was not matching React's.
React:
<div class='iui-tile-thumbnail-quick-action'>
<button class="iui-button iui-button-base iui-field">…</button>
</div>
CSS:
<button class="iui-button iui-button-base iui-field iui-tile-thumbnail-quick-action">…</button>
Made the changes in CSS demos to match React & had to update the CSS to work properly. The hover state of the buttons overlaying the thumbnail aren't even working properly in prod right now: https://itwin.github.io/iTwinUI/react/?mode=preview&story=tile--all-props
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.
If this is a visual bug fix, we would need css and react changesets for it.
Also, just wondering, since we corrected the css demo page to match what it used to be in react, could that change in the DOM be a breaking change for itwinui-css?
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 added this to the changesets. Unsure if this warrants a major or not.
This is done. @mayank99 & @Ben-Pusey-Bentley, I think this could use another review now. |
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.
Looking at your CI output, it looks like the changes that you have made to the CSS tile have also introduced some minor visual changes. It seems to be something with the border of the icon buttons. May want to tweak the CSS tile some more to avoid these visual changes, or you may want to approve some new test images, if you feel that the visual change is fine to keep. Diff:
@include mixins.iui-blur($opacity: 5); | ||
--_iui-button-icon-fill: var(--iui-color-white); | ||
.iui-tile-thumbnail-button { | ||
border-radius: 50%; |
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.
border-radius: 50%; | |
border-radius: var(--iui-border-radius-round); |
Feel like this should be changed, but will likely effect visuals tests. If we like this change, I'll make it right at the end to keep image test changes until the last push.
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.
LGTM
Changes
.iui-field
variables:--_iui-field-color-icon
--_iui-field-color-icon-hover
--_iui-field-color-icon-disabled
Testing
Docs
n/a