ADDED: Icon wrapper for more elegant way to placement icon in buttons

TODO: Add styles for selected segmented button
DONE: Base styles for segmented buttons
This commit is contained in:
doryan04 2024-02-09 23:25:46 +04:00
parent b0275dec80
commit 08c590c745
4 changed files with 20 additions and 8 deletions

View File

@ -21,7 +21,7 @@ export const SegmentButton = forwardRef<
ref={ref} ref={ref}
> >
<IconWrapper icon={icon} iconPlace={iconPlace}> <IconWrapper icon={icon} iconPlace={iconPlace}>
{props.children} <span className={'label-large'}>{props.children}</span>
</IconWrapper> </IconWrapper>
<span className={'m3 m3-button-segment-state-layer'} /> <span className={'m3 m3-button-segment-state-layer'} />
</ButtonLayout> </ButtonLayout>

View File

@ -5,13 +5,19 @@ div.m3.m3-segmented-buttons
border-radius: 20px border-radius: 20px
& > button.m3.m3-button-segment & > button.m3.m3-button-segment
width: max-content
border-radius: 0
box-sizing: border-box
height: 40px height: 40px
border-radius: 0
min-width: 108px min-width: 108px
width: max-content
box-sizing: border-box
border: 1px solid var(--md-sys-color-outline) border: 1px solid var(--md-sys-color-outline)
& > span
color: var(--md-sys-color-on-surface)
& > svg > text
fill: var(--md-sys-color-on-surface)
&:not(:first-child) &:not(:first-child)
margin-left: -1px margin-left: -1px

View File

@ -718,13 +718,19 @@ div.m3.m3-segmented-buttons {
border-radius: 20px; border-radius: 20px;
} }
div.m3.m3-segmented-buttons > button.m3.m3-button-segment { div.m3.m3-segmented-buttons > button.m3.m3-button-segment {
width: max-content;
border-radius: 0;
box-sizing: border-box;
height: 40px; height: 40px;
border-radius: 0;
min-width: 108px; min-width: 108px;
width: max-content;
box-sizing: border-box;
border: 1px solid var(--md-sys-color-outline); border: 1px solid var(--md-sys-color-outline);
} }
div.m3.m3-segmented-buttons > button.m3.m3-button-segment > span {
color: var(--md-sys-color-on-surface);
}
div.m3.m3-segmented-buttons > button.m3.m3-button-segment > svg > text {
fill: var(--md-sys-color-on-surface);
}
div.m3.m3-segmented-buttons > button.m3.m3-button-segment:not(:first-child) { div.m3.m3-segmented-buttons > button.m3.m3-button-segment:not(:first-child) {
margin-left: -1px; margin-left: -1px;
} }

File diff suppressed because one or more lines are too long