From f74211749dfed0d0f809afad172b4dae183173e0 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Thu, 3 Jul 2025 23:51:57 +0800 Subject: [PATCH] =?UTF-8?q?radius=20only-child=20=E7=94=9F=E6=95=88?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles/public/radius.tsx | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/styles/public/radius.tsx b/styles/public/radius.tsx index 9aac03b..659559a 100644 --- a/styles/public/radius.tsx +++ b/styles/public/radius.tsx @@ -59,8 +59,6 @@ export const radius = css` .ui.pointing.dropdown > .menu, .ui.loading.form.segments:before, .ui.secondary.menu .dropdown.item > .menu, - .ui.vertical.menu > .active.item:only-child, - .ui.segments:not(.horizontal) > .segment:only-child, .ui.segments:not(.horizontal) > .segment:has(~ .tw-hidden) { border-radius: ${otherThemeVars.border.radius}; } @@ -100,8 +98,7 @@ export const radiusTop = css` .ui.modal > i.icon:first-child + *, .ui.modal > .dimmer:first-child + i.icon + *, .ui.modal > .dimmer:first-child + *:not(.icon), - .ui.modal > :first-child:not(.icon):not(.dimmer), - .ui.table > thead > tr:first-child > th:only-child { + .ui.modal > :first-child:not(.icon):not(.dimmer) { border-radius: ${otherThemeVars.border.radius} ${otherThemeVars.border.radius} 0 0; } `; @@ -149,15 +146,6 @@ export const radiusBottom = css` } } - .ui.table > tfoot > tr:first-child { - > th, - > td { - &:only-child { - border-radius: 0 0 ${otherThemeVars.border.radius} ${otherThemeVars.border.radius}; - } - } - } - .ui.bottom.attached.header, .ui[class*="bottom attached"].table, .ui.segment[class*="bottom attached"], @@ -257,3 +245,24 @@ export const radiusBottomRight = css` border-bottom-right-radius: ${otherThemeVars.border.radius}; } `; + +// only-child 顺序最后生效 +export const onlyChild = css` + .ui.vertical.menu > .active.item:only-child, + .ui.segments:not(.horizontal) > .segment:only-child { + border-radius: ${otherThemeVars.border.radius}; + } + + .ui.table > thead > tr:first-child > th:only-child { + border-radius: ${otherThemeVars.border.radius} ${otherThemeVars.border.radius} 0 0; + } + + .ui.table > tfoot > tr:first-child { + > th, + > td { + &:only-child { + border-radius: 0 0 ${otherThemeVars.border.radius} ${otherThemeVars.border.radius}; + } + } + } +`;