Skip to content

Commit 9ac3738

Browse files
authoredMay 20, 2024
fix(Switch): フォーカスリングが表示されるように修正 (#4650)
1 parent c6adb0c commit 9ac3738

File tree

1 file changed

+3
-3
lines changed
  • packages/smarthr-ui/src/components/Switch

1 file changed

+3
-3
lines changed
 

‎packages/smarthr-ui/src/components/Switch/Switch.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const switchStyle = tv({
77
slots: {
88
wrapper: [
99
// Switch 本体
10-
'shr-border-shorthand shr-relative shr-inline-flex shr-w-[calc(theme(fontSize.base)*2)] shr-items-center shr-rounded-full shr-bg-white',
10+
'shr-border-shorthand shr-relative shr-inline-flex shr-w-[calc(theme(fontSize.base)*2)] shr-items-center shr-rounded-full shr-bg-white shr-h-fit',
1111
// 理想的には padding: 2px; だが、box-shadow を outline で使用しているため、border と padding で2pxの疑似余白を作っている。
1212
'shr-p-px',
13-
// :focus-visible-within の代替
14-
'has-[:focus-visible]:shr-focus-indicator',
13+
// :focus-visible-within の代替, なぜかhasが機能しないので以下の書き方で代用している
14+
'has-[:focus-visible]:shr-focus-indicator [&:has(:focus-visible)]:shr-focus-indicator',
1515
'has-[:checked]:shr-border-[theme(colors.main)] has-[:checked]:shr-bg-main',
1616
'has-[:disabled]:shr-border-[theme(borderColor.default)] has-[:disabled]:shr-bg-border',
1717
'forced-colors:has-[:disabled]:shr-border-[GrayText]',

0 commit comments

Comments
 (0)