RocketCommunicationsInc / astro

Astro UXDS is a collection of guidelines, patterns and components for designing space-based user interface applications.
https://astrouxds.com
Other
115 stars 25 forks source link

rux-button icon-only - no change in icon size with size prop #891

Closed NicDominguez closed 1 year ago

NicDominguez commented 2 years ago

Describe the bug When using rux-button as an icon only button I would expect the icon size to grow with the size prop. It does not appear to respond to the size prop except to shift position as the container grows.

To Reproduce Can see issue in Astro storybook https://astro-components.netlify.app/?path=/story/components-button--borderless&args=borderless:false;iconOnly:true;icon:more-vert;disabled:false;size:large;type:button

Current behavior Icon does not change in size at all in response to the prop. Use of shadow parts is necessary for changing size but that introduces issues with positioning inside the button container.

Expected behavior

When in icon-only mode have the icon scale with the size prop.

Screenshots size=small image size=medium image size=large image

CodeSandbox

Environment (please complete the following information):

Additional context This may be intended functionality but I find it unintuitive if the size property is really just padding and the internal text/icon does not scale with the padding.

dmcalester commented 2 years ago

Hey Nick, this is currently the intended behavior for sizing in Astro adjusting padding only. The topic has been broached before, but hadn’t been a priority for investigating further. Aside from it being unintuitive are there other problems it’s causing?

micahjones13 commented 1 year ago

I worked with Nic on this one and he found a workaround with the icon shadow part. The difficulty was figuring out MUI syntax to access the part 😆 I believe this is working as intended now that the shadow part is being accessed. Case closed 🕵️