mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Remove CSS has selector and improve various styles (#26891)
				
					
				
			Replace #26850 Major changes: 1. Remove all `has` selectors, it is still not supported by firefox. Actually there could be some more general and clearer approaches 2. Remove `two-toggle-buttons`, the `.ui.buttons` just works well 3. Rewrite the `.ui.buttons` border styles, see the screenshots 4. Remove the "fine-tuning" paddings from the the flex children, they could layout themselves well.    
This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| /* this contains override styles for buttons and related elements */ | ||||
|  | ||||
| /* these styles changed the Fomantic UI's rules, Fomantic UI expects only "basic" buttons have borders */ | ||||
| .ui.button, | ||||
| .ui.button:focus { | ||||
|   background: var(--color-button); | ||||
| @@ -52,26 +53,29 @@ a.btn:hover { | ||||
|   color: inherit; | ||||
| } | ||||
|  | ||||
| /* other button styles */ | ||||
| /* 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 */ | ||||
|  | ||||
| .ui.buttons .button { | ||||
|   border-right: none; | ||||
| } | ||||
|  | ||||
| .ui.buttons .button:first-child { | ||||
|   border-left: 1px solid var(--color-light-border); | ||||
| } | ||||
|  | ||||
| .ui.buttons .button:first-child:has(+ .button.active) { | ||||
|   border-right: none !important; | ||||
| .ui.buttons .button:last-child { | ||||
|   border-right: 1px solid var(--color-light-border); | ||||
| } | ||||
|  | ||||
| .ui.buttons .button + .button:not(.active) { | ||||
|   border-left: none; | ||||
| } | ||||
|  | ||||
| .two-toggle-buttons .button:not(.active):first-of-type { | ||||
|   border-right: none; | ||||
| } | ||||
|  | ||||
| .two-toggle-buttons .button.active:last-of-type { | ||||
| .ui.buttons .button.active { | ||||
|   border-left: 1px solid var(--color-light-border); | ||||
|   border-right: 1px solid var(--color-light-border); | ||||
| } | ||||
|  | ||||
| .ui.buttons .button.active + .button { | ||||
|   border-left: none; | ||||
| } | ||||
|  | ||||
| .ui.labeled.button.disabled > .button, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user