Skip to content

Commit a1e30bf

Browse files
committed
fix: fix button group rtl styles
1 parent 90e13b3 commit a1e30bf

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ tsconfig.*.json
2323
.rollup.cache
2424
/cache
2525
/.nx
26+
.tool-versions

system/core/src/components/ButtonGroup.ts

+34-9
Original file line numberDiff line numberDiff line change
@@ -73,32 +73,57 @@ export const fullStyles = css`
7373
}
7474
7575
&:first-child {
76-
border-top-left-radius: var(--border-radius-small);
77-
border-bottom-left-radius: var(--border-radius-small);
76+
[dir='ltr'] & {
77+
border-top-left-radius: var(--border-radius-small);
78+
border-bottom-left-radius: var(--border-radius-small);
79+
}
80+
[dir='rtl'] & {
81+
border-top-right-radius: var(--border-radius-small);
82+
border-bottom-right-radius: var(--border-radius-small);
83+
}
7884
--tk-button-box-shadow: inset 0 0 0 1px var(--tk-button-border-color);
7985
8086
&[data-pseudo='focus'],
8187
&:focus-visible {
8288
&:after {
83-
border-top-left-radius: 6px;
84-
border-bottom-left-radius: 6px;
89+
[dir='ltr'] & {
90+
border-top-left-radius: 6px;
91+
border-bottom-left-radius: 6px;
92+
}
93+
[dir='rtl'] & {
94+
border-top-right-radius: 6px;
95+
border-bottom-right-radius: 6px;
96+
}
8597
}
8698
}
8799
}
88100
89101
&:not(:first-child) {
90-
margin-left: -1px;
102+
marhin-inline-start: -1px;
103+
-webkit-margin-start: -1px;
91104
}
92105
93106
&:last-child {
94-
border-top-right-radius: var(--border-radius-small);
95-
border-bottom-right-radius: var(--border-radius-small);
107+
[dir='ltr'] & {
108+
border-top-right-radius: var(--border-radius-small);
109+
border-bottom-right-radius: var(--border-radius-small);
110+
}
111+
[dir='rtl'] & {
112+
border-top-left-radius: var(--border-radius-small);
113+
border-bottom-left-radius: var(--border-radius-small);
114+
}
96115
97116
&[data-pseudo='focus'],
98117
&:focus-visible {
99118
&:after {
100-
border-top-right-radius: 6px;
101-
border-bottom-right-radius: 6px;
119+
[dir='ltr'] & {
120+
border-top-right-radius: 6px;
121+
border-bottom-right-radius: 6px;
122+
}
123+
[dir='rtl'] & {
124+
border-top-left-radius: 6px;
125+
border-bottom-left-radius: 6px;
126+
}
102127
}
103128
}
104129
}

0 commit comments

Comments
 (0)