I’m trying to port my rich text field editor to the new Polaris components. The new tooltip and popover (I’ve found them while reading the minified code) are awesome, great work on that, I love how you guys embraced the new standards (including the interestFor) for that.
I found a missing feature though with the button component. I’d like to convey a “pressed” state where the button is active:
@Anthony_Frehner do you think this could be added? For now the only workaround I’ve found is to use the secondary variant as an “active” state, but it’s not wonderful, visually speaking:
I really like the editor you are building, are you using anything like Lexical behind the scene? Does it support markdown?
Anyway, a pressed state would be much easier to handle this kind of stuff.
I used this approach for tabs, however, I had to set a custom font-size at 0.8rem as the s-paragraph and s-text is bigger than the font-size is a s-button.
Thanks! I thought of this but I would prefer to use a button (I feel it is better for accessibility as those are really buttons) but I’ll fallback to s-clickable.
@Anthony_Frehner I’ve tried to use s-clickable, and play with the strong background when active vs subdued when not, and using the info tone of the color. In overall this is not optimal, the idfference in background is too light, and the blue used in the “info” icon seems to not be used anywhere in Shopify admin, creating an odd layout:
I think the color tones should be tweak to have more difference, but I think a dedicated “pressed” prop for the buttons would be really useful, as it would not require having to choose ourself the variation for the “applied button.