mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Markdown task list improvements (#13952)
* Markdown task list improvements - Remove `.ui` class and wrappers to prevent fomantic from messing with it. - Change rendered HTML to match GitHub. - Add custom styling for the checkboxes. * fix unittest Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
		| @@ -162,9 +162,57 @@ | ||||
|     list-style-type: none; | ||||
|   } | ||||
|  | ||||
|   li.task-list-item { | ||||
|   .task-list-item { | ||||
|     list-style-type: none; | ||||
|     margin-left: calc(-2em + 2px); | ||||
|  | ||||
|     input[type="checkbox"] { | ||||
|       margin: 0 6px .25em -1.6em; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .task-list-item + .task-list-item { | ||||
|     margin-top: 3px; | ||||
|   } | ||||
|  | ||||
|   input[type="checkbox"] { | ||||
|     -webkit-appearance: none; | ||||
|     -moz-appearance: none; | ||||
|     appearance: none; | ||||
|     position: relative; | ||||
|     border: 1px solid var(--color-secondary); | ||||
|     border-radius: 2px; | ||||
|     background: var(--color-input-background); | ||||
|     height: 14px; | ||||
|     width: 14px; | ||||
|     opacity: 1 !important; // override fomantic on edit preview | ||||
|     pointer-events: auto !important; // override fomantic on edit preview | ||||
|     vertical-align: middle !important; // override fomantic on edit preview | ||||
|   } | ||||
|  | ||||
|   input[type="checkbox"]:not([disabled]):hover, | ||||
|   input[type="checkbox"]:not([disabled]):active { | ||||
|     border-color: var(--color-primary); | ||||
|   } | ||||
|  | ||||
|   input[type="checkbox"]::after { | ||||
|     position: absolute; | ||||
|     left: 0; | ||||
|     top: 0; | ||||
|     bottom: 0; | ||||
|     right: 0; | ||||
|     pointer-events: none; | ||||
|     background: var(--color-text); | ||||
|     mask-size: cover; | ||||
|   } | ||||
|  | ||||
|   input[type="checkbox"]:checked::after { | ||||
|     content: ""; | ||||
|     mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>'); | ||||
|   } | ||||
|  | ||||
|   input[type="checkbox"]:indeterminate::after { | ||||
|     content: ""; | ||||
|     mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>'); | ||||
|   } | ||||
|  | ||||
|   ul ul, | ||||
| @@ -422,10 +470,6 @@ | ||||
|     box-shadow: inset 0 -1px 0 var(--color-secondary); | ||||
|   } | ||||
|  | ||||
|   input[type="checkbox"] { | ||||
|     vertical-align: middle !important; | ||||
|   } | ||||
|  | ||||
|   .csv-data td, | ||||
|   .csv-data th { | ||||
|     padding: 5px; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user