2024-04-14 19:53:52 +02:00
. ui . button {
cursor : pointer ;
2025-04-16 16:14:10 +08:00
display : inline-flex ;
2024-04-14 19:53:52 +02:00
outline : none ;
font-family : var ( --fonts-regular ) ;
margin : 0 0 . 25em 0 0 ;
font-weight : var ( --font-weight-normal ) ;
2025-04-16 16:14:10 +08:00
font-size : 1rem ;
2024-04-14 19:53:52 +02:00
text-align : center ;
text-decoration : none ;
line-height : 1 ;
2025-04-16 16:14:10 +08:00
border-radius : var ( --border-radius ) ;
2024-04-14 19:53:52 +02:00
user-select : none ;
-webkit-tap-highlight-color : transparent ;
justify-content : center ;
2023-05-29 14:45:22 +02:00
background : var ( --color-button ) ;
border : 1px solid var ( --color-light-border ) ;
color : var ( --color-text ) ;
2024-04-14 19:53:52 +02:00
white-space : nowrap ;
}
2024-08-12 02:40:18 +02:00
. ui . button : focus-visible {
box-shadow : inset 0 0 0 2px currentcolor ;
}
2024-04-14 19:53:52 +02:00
@ media ( max-width : 767 . 98px ) {
. ui . button {
white-space : normal ;
}
2023-05-29 14:45:22 +02:00
}
2023-06-09 10:37:47 +02:00
. ui . button : hover {
2023-05-29 14:45:22 +02:00
background : var ( --color-hover ) ;
2023-06-09 10:37:47 +02:00
color : var ( --color-text ) ;
2023-05-29 14:45:22 +02:00
}
. ui . active . button ,
. ui . button : active ,
. ui . active . button : active ,
. ui . active . button : hover {
background : var ( --color-active ) ;
color : var ( --color-text ) ;
}
2024-04-14 19:53:52 +02:00
. ui . buttons . disabled . button : not ( . basic ) ,
. ui . disabled . button ,
. ui . button : disabled ,
. ui . disabled . button : hover ,
. ui . disabled . active . button {
cursor : default ;
opacity : var ( --opacity-disabled ) ! important ;
background-image : none ;
pointer-events : none ! important ;
2023-06-09 10:37:47 +02:00
}
2025-04-16 16:14:10 +08:00
/* there is no "ui labeled icon button" support" because it is not used */
2024-04-14 19:53:52 +02:00
. ui . labeled . button : not ( . icon ) {
flex-direction : row ;
background : none ;
2025-04-16 16:14:10 +08:00
padding : 0 ;
2023-06-09 10:37:47 +02:00
border : none ;
2025-04-16 16:14:10 +08:00
min-height : unset ;
2024-04-14 19:53:52 +02:00
}
. ui . labeled . button > . button {
2023-06-09 10:37:47 +02:00
margin : 0 ;
2024-04-16 17:46:12 +02:00
border-top-right-radius : 0 ;
border-bottom-right-radius : 0 ;
2023-06-09 10:37:47 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . labeled . button > . label {
display : flex ;
align-items : center ;
margin : 0 0 0 -1px ! important ;
font-size : 1em ;
border-color : var ( --color-light-border ) ;
2024-04-16 17:46:12 +02:00
border-top-left-radius : 0 ;
border-bottom-left-radius : 0 ;
}
. ui . labeled . button > . label : hover {
background : var ( --color-hover ) ;
}
. ui . labeled . button > . button : hover + . label {
border-left-color : var ( --color-secondary-dark-2 ) ;
2023-06-09 10:37:47 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . button > . icon : not ( . button ) {
height : auto ;
opacity : 0 . 8 ;
2023-06-09 10:37:47 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . button : not ( . icon ) > . icon : not ( . button ) : not ( . dropdown ) ,
. ui . button : not ( . icon ) > . icons : not ( . button ) : not ( . dropdown ) {
margin : 0 0 . 42857143em 0 -0 . 21428571em ;
vertical-align : baseline ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . button : not ( . icon ) > . icons : not ( . button ) : not ( . dropdown ) > . icon {
vertical-align : baseline ;
2024-03-25 11:14:43 +01:00
}
2024-04-14 19:53:52 +02:00
. ui . button : not ( . icon ) > . right . icon : not ( . button ) : not ( . dropdown ) {
margin : 0 -0 . 21428571em 0 0 . 42857143em ;
2024-03-24 13:14:03 +01:00
}
2025-04-16 16:14:10 +08:00
/* reference sizes (not exactly at the moment): normal: padding-x=21, height=38 ; compact: padding-x=15, height=32 */
. ui . button { /* stylelint-disable-line no-duplicate-selectors */
min-height : 38px ;
padding : 0 . 57em /* around 8px */ 1 . 43em /* around 20px */ ;
}
2024-04-14 19:53:52 +02:00
. ui . compact . buttons . button ,
. ui . compact . button {
2025-04-16 16:14:10 +08:00
padding : 0 . 42em /* around 8px */ 1 . 07em /* around 15px */ ;
min-height : 32px ;
2023-06-01 12:47:28 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . compact . icon . buttons . button ,
. ui . compact . icon . button {
2025-04-16 16:14:10 +08:00
padding : 0 . 57em /* around 8px */ ;
2023-05-29 14:45:22 +02:00
}
2025-04-16 16:14:10 +08:00
/* reference size: mini: padding-x=16, height=30 ; compact: padding-x=12, height=26 */
2024-04-14 19:53:52 +02:00
. ui . mini . buttons . dropdown ,
. ui . mini . buttons . dropdown . menu > . item ,
. ui . mini . buttons . button ,
. ui . ui . ui . ui . mini . button {
2025-04-16 16:14:10 +08:00
font-size : 11px ;
min-height : 30px ;
}
. ui . ui . ui . ui . mini . button . compact {
min-height : 26px ;
2024-04-14 19:53:52 +02:00
}
2025-04-16 16:14:10 +08:00
/* reference size: tiny: padding-x=18, height=32 ; compact: padding-x=13, height=28 */
2024-04-14 19:53:52 +02:00
. ui . tiny . buttons . dropdown ,
. ui . tiny . buttons . dropdown . menu > . item ,
. ui . tiny . buttons . button ,
. ui . ui . ui . ui . tiny . button {
2025-04-16 16:14:10 +08:00
font-size : 12px ;
min-height : 32px ;
}
. ui . ui . ui . ui . tiny . button . compact {
min-height : 28px ;
2024-04-14 19:53:52 +02:00
}
2025-04-16 16:14:10 +08:00
/* reference size: small: padding-x=19, height=34 ; compact: padding-x=14, height=30 */
2024-04-14 19:53:52 +02:00
. ui . small . buttons . dropdown ,
. ui . small . buttons . dropdown . menu > . item ,
. ui . small . buttons . button ,
. ui . ui . ui . ui . small . button {
2025-04-16 16:14:10 +08:00
font-size : 13px ;
min-height : 34px ;
}
. ui . ui . ui . ui . small . button . compact {
min-height : 30px ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . icon . buttons . button ,
. ui . icon . button : not ( . compact ) {
2025-04-16 16:14:10 +08:00
padding : 0 . 57em ;
2024-04-14 19:53:52 +02:00
}
. ui . icon . buttons . button > . icon ,
. ui . icon . button > . icon {
margin : 0 ! important ;
vertical-align : top ;
2023-05-29 14:45:22 +02:00
}
2023-09-19 00:05:31 +02:00
. ui . basic . buttons . button ,
2024-04-14 19:53:52 +02:00
. ui . basic . button {
2025-04-16 16:14:10 +08:00
border-radius : var ( --border-radius ) ;
2024-04-14 19:53:52 +02:00
background : none ;
2023-09-19 00:05:31 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . basic . buttons {
border : 1px solid var ( --color-secondary ) ;
2025-04-16 16:14:10 +08:00
border-radius : var ( --border-radius ) ;
2024-04-14 19:53:52 +02:00
}
. ui . basic . buttons . button {
border-radius : 0 ;
border-left : 1px solid var ( --color-secondary ) ;
2024-02-28 21:26:12 +01:00
}
2023-05-29 14:45:22 +02:00
. ui . labeled . button . disabled > . button ,
. ui . basic . buttons . button ,
2024-04-14 19:53:52 +02:00
. ui . basic . button {
2023-05-29 14:45:22 +02:00
color : var ( --color-text-light ) ;
2023-06-09 10:37:47 +02:00
background : var ( --color-button ) ;
2023-05-29 14:45:22 +02:00
}
. ui . basic . buttons . button : hover ,
. ui . basic . button : hover {
color : var ( --color-text ) ;
background : var ( --color-hover ) ;
2024-03-24 13:14:03 +01:00
border-color : var ( --color-secondary-dark-2 ) ;
2023-05-29 14:45:22 +02:00
}
. ui . basic . buttons . button : active ,
. ui . basic . button : active ,
. ui . basic . buttons . active . button ,
. ui . basic . active . button ,
. ui . basic . buttons . active . button : hover ,
. ui . basic . active . button : hover {
color : var ( --color-text ) ;
background : var ( --color-active ) ;
}
2024-04-14 19:53:52 +02:00
. ui . button . toggle . active {
background-color : var ( --color-green ) ;
color : var ( --color-white ) ;
}
. ui . button . toggle . active : hover {
background-color : var ( --color-green-dark-1 ) ;
color : var ( --color-white ) ;
}
. ui . fluid . button {
width : 100 % ;
display : block ;
}
2023-05-29 14:45:22 +02:00
. ui . primary . button ,
2024-04-14 19:53:52 +02:00
. ui . primary . buttons . button {
2023-05-29 14:45:22 +02:00
background : var ( --color-primary ) ;
2023-10-16 15:26:08 +08:00
color : var ( --color-primary-contrast ) ;
2023-05-29 14:45:22 +02:00
}
. ui . primary . button : hover ,
2023-06-09 10:37:47 +02:00
. ui . primary . buttons . button : hover {
2023-05-29 14:45:22 +02:00
background : var ( --color-primary-hover ) ;
2023-10-16 15:26:08 +08:00
color : var ( --color-primary-contrast ) ;
2023-05-29 14:45:22 +02:00
}
. ui . primary . button : active ,
. ui . primary . buttons . button : active {
background : var ( --color-primary-active ) ;
}
. ui . basic . primary . buttons . button ,
2024-04-14 19:53:52 +02:00
. ui . basic . primary . button {
2023-05-29 14:45:22 +02:00
color : var ( --color-primary ) ;
border-color : var ( --color-primary ) ;
2024-04-14 19:53:52 +02:00
background : none ;
2023-05-29 14:45:22 +02:00
}
. ui . basic . primary . buttons . button : hover ,
2023-06-09 10:37:47 +02:00
. ui . basic . primary . button : hover {
2023-05-29 14:45:22 +02:00
color : var ( --color-primary-hover ) ;
border-color : var ( --color-primary-hover ) ;
}
. ui . basic . primary . buttons . button : active ,
. ui . basic . primary . button : active {
color : var ( --color-primary-active ) ;
border-color : var ( --color-primary-active ) ;
}
. ui . red . button ,
2024-04-14 19:53:52 +02:00
. ui . red . buttons . button {
2024-04-15 19:20:32 +02:00
color : var ( --color-white ) ;
2023-05-29 14:45:22 +02:00
background : var ( --color-red ) ;
}
. ui . red . button : hover ,
2023-06-09 10:37:47 +02:00
. ui . red . buttons . button : hover {
2023-05-29 14:45:22 +02:00
background : var ( --color-red-dark-1 ) ;
}
. ui . red . button : active ,
. ui . red . buttons . button : active {
background : var ( --color-red-dark-2 ) ;
}
. ui . basic . red . buttons . button ,
2024-04-14 19:53:52 +02:00
. ui . basic . red . button {
2023-05-29 14:45:22 +02:00
color : var ( --color-red ) ;
border-color : var ( --color-red ) ;
2024-04-14 19:53:52 +02:00
background : none ;
2023-05-29 14:45:22 +02:00
}
. ui . basic . red . buttons . button : hover ,
2023-06-09 10:37:47 +02:00
. ui . basic . red . button : hover {
2023-05-29 14:45:22 +02:00
color : var ( --color-red-dark-1 ) ;
border-color : var ( --color-red-dark-1 ) ;
}
. ui . basic . red . buttons . button : active ,
. ui . basic . red . button : active {
color : var ( --color-red-dark-2 ) ;
border-color : var ( --color-red-dark-2 ) ;
}
. ui . green . button ,
2024-04-14 19:53:52 +02:00
. ui . green . buttons . button {
2024-04-15 19:20:32 +02:00
color : var ( --color-white ) ;
2023-05-29 14:45:22 +02:00
background : var ( --color-green ) ;
}
. ui . green . button : hover ,
2023-06-09 10:37:47 +02:00
. ui . green . buttons . button : hover {
2023-05-29 14:45:22 +02:00
background : var ( --color-green-dark-1 ) ;
}
. ui . green . button : active ,
. ui . green . buttons . button : active {
background : var ( --color-green-dark-2 ) ;
}
. ui . basic . green . buttons . button ,
2024-04-14 19:53:52 +02:00
. ui . basic . green . button {
2023-05-29 14:45:22 +02:00
color : var ( --color-green ) ;
border-color : var ( --color-green ) ;
2024-04-14 19:53:52 +02:00
background : none ;
2023-05-29 14:45:22 +02:00
}
. ui . basic . green . buttons . button : hover ,
2023-06-09 10:37:47 +02:00
. ui . basic . green . button : hover {
2023-05-29 14:45:22 +02:00
color : var ( --color-green-dark-1 ) ;
border-color : var ( --color-green-dark-1 ) ;
}
. ui . basic . green . buttons . button : active ,
. ui . basic . green . button : active {
color : var ( --color-green-dark-2 ) ;
border-color : var ( --color-green-dark-2 ) ;
}
2024-04-14 19:53:52 +02:00
. ui . buttons {
display : inline-flex ;
flex-direction : row ;
font-size : 0 ;
vertical-align : baseline ;
margin : 0 0 . 25em 0 0 ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. delete-button ,
. delete-button : hover {
color : var ( --color-red ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
/* btn is a plain button without any opinionated styling, it only uses flex for vertical alignment like ".ui.button" in base.css */
2023-05-29 14:45:22 +02:00
2024-04-14 19:53:52 +02:00
. btn {
background : transparent ;
border-radius : var ( --border-radius ) ;
border : none ;
color : inherit ;
margin : 0 ;
padding : 0 ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. btn : hover ,
. btn : active {
background : none ;
border : none ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
a . btn ,
a . btn : hover {
color : inherit ;
2023-05-29 14:45:22 +02:00
}
2025-04-19 16:43:22 +08:00
. btn . tiny {
font-size : 12px ;
}
. btn . small {
font-size : 13px ;
}
2024-04-14 19:53:52 +02:00
/ * By default , Fomantic UI doesn ' t support "bordered" buttons group , but Gitea would like to use it .
And the default buttons always have borders now ( not the same as Fomantic UI ' s default buttons , see above ) .
It needs some tricks to tweak the left / right borders with active state * /
2023-05-29 14:45:22 +02:00
2024-04-14 19:53:52 +02:00
. ui . buttons . button {
border-right : none ;
flex : 1 0 auto ;
border-radius : 0 ;
margin : 0 ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button : first-child {
border-left : none ;
margin-left : 0 ;
2025-04-16 16:14:10 +08:00
border-top-left-radius : var ( --border-radius ) ;
border-bottom-left-radius : var ( --border-radius ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button : last-child {
2025-04-16 16:14:10 +08:00
border-top-right-radius : var ( --border-radius ) ;
border-bottom-right-radius : var ( --border-radius ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button : hover {
border-color : var ( --color-secondary-dark-2 ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button : hover + . button {
border-left : 1px solid var ( --color-secondary-dark-2 ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
/* TODO: these "tw-hidden" selectors are only used by "blame.tmpl" buttons: Raw/Normal View/History/Unescape, need to be refactored to a clear solution later */
. ui . buttons . button : first-child ,
. ui . buttons . button . tw-hidden : first-child + . button {
border-left : 1px solid var ( --color-light-border ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button : last-child ,
. ui . buttons . button : nth-last-child ( 2 ) : has ( + . button . tw-hidden ) {
border-right : 1px solid var ( --color-light-border ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button . active {
border-left : 1px solid var ( --color-light-border ) ;
border-right : 1px solid var ( --color-light-border ) ;
2023-05-29 14:45:22 +02:00
}
2024-04-14 19:53:52 +02:00
. ui . buttons . button . active + . button {
border-left : none ;
2023-05-29 14:45:22 +02:00
}