-
Notifications
You must be signed in to change notification settings - Fork 2
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
ToggleButton and ToggleButtonGroup #358
Conversation
So far looks actually pretty okay and we can get it in IMHO, I don't see the point on calling this POC but the only thing is the you can't unselect a button (returning a group to its default state depending default state is selected a button or nothing is selected) The story book also needs work (disabled state, etc.) |
Everything I did is in this commit: 744d6c1 |
background-color: $wikit-ToggleButton-disabled-background-color; | ||
} | ||
|
||
@media (max-width: $width-breakpoint-mobile) { |
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 storybook, I have the strong suspicion that this media-query is not working
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 double checked it before making the patch and it worked fine. Maybe you're checking against tablet breakpoint? The mobile breakpoint is pretty small.
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.
My bad, the media-query is indeed working fine!
It is that box-sizing: border-box;
is missing. That is why the buttons are so strangely large ^^
The m-sized buttons are supposed to have a total height of 32px, not 44px :)
Also, @SaiSan-WMDE , I think we might be missing some component tokens for the min-height.
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.
Added box-sizing: border-box;
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.
Hi! Thanks for working on this, and for adding box-sizing: border-box;
. The size of buttons looks good now. We do have min-height tokens, but we haven't been using them with the button component because they proved to be unnecessary. Should that change?
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.
Quick question: In they proved to be unnecessary
, by they you mean the min-height css style or the min-height tokens?
The min-height css styles are in the figma specs and I set them as it's there. If we need to not use them, that's fine.
If that's about the tokens themselves, I'm fine with moving like this.
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.
Using the CSS style, and therefore the tokens to define it, seemed to not have a real impact on the component, as far as I remember. I'd say we can move on like this.
I should be rephrasing many of the Figma specs, to avoid them from being interpreted as implementation decisions. Now that UX creates component tokens, these should be considered the design source of truth by developers.
(Leaving more feedback in a separate comment)
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.
Done. Removed the min-height css.
4dfb8f4
to
ea7fc35
Compare
This is looking fantastic. The main thing to solve from a UI point of view is still the border radius of the buttons that occupy a central position: for some reason is still not 0px. |
ea7fc35
to
344d399
Compare
I couldn't find any issues with on main toggle group but I saw the problem in the disabled one, It should be fixed now. |
It appears that the buttons are not displaying the right border radius in none of the states (checking on Chrome/MacOS): Buttons should look more integrated in the group. Adjacent borders should not display any roundness: |
aha, it looks fine in firefox but not in chrome :( |
In Chrome it says "unknown property type" for border-start-start-radius: 0; and the rest. |
It's not working on Chrome below 89 https://caniuse.com/?search=border-start-start-radius, we can have it now and slowly wait until it rolls out? |
oh nooo. That's usually the other way around.
I actually checked the component on Chrome 89 using BrowserStack and the borders still look broken :-/ |
Should we use |
That would break in RTL languages :( We can go with it for now? |
344d399
to
a01fde1
Compare
The installed postcss plugin |
This is very likely this: csstools/postcss-logical#27 |
a01fde1
to
3e4c7e1
Compare
Until that issue is resolved. I made a change that basically is the post-build of postcss and it should work just fine 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 great, thanks for picking this up! I've added a request for change as a result of a small discussion above, I will review again after the design is approved.
LOL, didn't see this comment, as I was on the review screen, sorry for repeating what you said. |
3e4c7e1
to
f999655
Compare
Agh, not sure what changed, but the borders were fixed before the last commit, and now they look off again 😮 Last thing from a design pov. The focus state needs fixing:
|
It's broken again because chrome doesn't :dir() either: https://caniuse.com/?search=dir() |
Also looking at output of postcss-logical, it outputs something like |
I think a quick way around it is to wrap the story with a div that sets the |
BTW, This can be fixed by setting |
f999655
to
c58ff79
Compare
Ok, current status. Firefox:
Chrome: Same issues persist:
|
Can't reproduce the dotted border in firefox either :( |
Co-authored-by: Sai_San <sarai.sanchez@wikimedia.de>
Co-authored-by: Sai_San <sarai.sanchez@wikimedia.de>
Sure. Applied. |
I was looking at the seemingly fresh Chromatic link. The one that technically was generated after adding Full disclosure, the focus styles will be updated in a separate task that impacts tokens at a higher level (T272626), but that's a different story to be tackled by the constellation. Here everything looks good! 💯 Thanks sooo much, Amir 🙏 |
* create skeleton * Update ToggleButton.json * Update tokens/properties/components/ToggleButton.json * Update ToggleButton.json * ToggleButton and ToggleButtonGroup (#358) * ToggleButton PoC * Second attempt: fix it in render * Silencing typescript errors * Use provide/inject * Fixed injection types * Add documentation to props and slots * Make ToggleButton ready for review * Fixes * Update vue-components/src/components/ToggleButton.vue Co-authored-by: Sai_San <sarai.sanchez@wikimedia.de> * Update vue-components/src/components/ToggleButton.vue Co-authored-by: Sai_San <sarai.sanchez@wikimedia.de> Co-authored-by: Amir Sarabadani <Ladsgroup@gmail.com> Co-authored-by: Sai_San <sarai.sanchez@wikimedia.de> * Final fixes Co-authored-by: Michael Große <michael.grosse@wikimedia.de> Co-authored-by: Amir Sarabadani <Ladsgroup@gmail.com>
Works, but not sure if those props make any sense at all