mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 19:10:08 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			108 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			CSS
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			108 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			CSS
		
	
	
		
			Executable File
		
	
	
	
	
| 
 | |
| :root {
 | |
| 	--button-size: 2em;
 | |
| 
 | |
| 	font-family: sans-serif;
 | |
| 	font-size: 5mm;
 | |
| }
 | |
| 
 | |
| .editor {
 | |
| 	display: block;
 | |
| 	position: relative;
 | |
| }
 | |
| 
 | |
| .editor .outline {
 | |
| 	display: block;
 | |
| 	position: relative;
 | |
| 	/* XXX do a better calculation... */
 | |
| 	width: calc(100% - (var(--button-size) + 4em));
 | |
| }
 | |
| 
 | |
| .editor .outline [tabindex] {
 | |
| 	position: relative;
 | |
| }
 | |
| .editor .outline div [tabindex] {
 | |
| 	margin-left: 2em;
 | |
| }
 | |
| .editor .outline [tabindex]>span,
 | |
| .editor .outline [tabindex]>textarea {
 | |
| 	--padding: 0.2em;
 | |
| 
 | |
| 	display: block;
 | |
| 	width: 100%;
 | |
| 	/* XXX this is a tiny bit off and using textarea's height here is off too... */
 | |
| 	min-height: 1em;
 | |
| 	padding: var(--padding);
 | |
| 	margin: 0;
 | |
| 
 | |
| 	font-family: sans-serif;
 | |
| 	font-size: 5mm;
 | |
| 
 | |
| 	outline: none;
 | |
| 	border: none;
 | |
| }
 | |
| .editor .outline [tabindex]>textarea {
 | |
| 	height: calc(2 * var(--padding) + 1em);
 | |
| 	overflow: hidden;
 | |
| 	resize: none;
 | |
| }
 | |
| 
 | |
| /* show/hide node's view/code... */
 | |
| .editor .outline [tabindex]>span+textarea:not(:focus),
 | |
| /* XXX not sure how to do this without :has(..)... */
 | |
| .editor .outline [tabindex]:has(>span+textarea:focus)>span:has(+textarea),
 | |
| .editor .outline [tabindex]:focus>span+textarea {
 | |
| 	position: absolute;
 | |
| 	opacity: 0;
 | |
| 	top: 0;
 | |
| }
 | |
| 
 | |
| /* focus... */
 | |
| .editor .outline [tabindex]:focus {
 | |
| 	/*outline: solid 0.2em silver;*/
 | |
| 	outline: none;
 | |
| }
 | |
| .editor .outline [tabindex]:focus>span,
 | |
| .editor .outline [tabindex]:focus>textarea {
 | |
| 	background: rgba(0,0,0,0.1);
 | |
| }
 | |
| .editor .outline [tabindex].focused:not(:focus)>span,
 | |
| .editor .outline [tabindex].focused:not(:focus)>textarea {
 | |
| 	background: rgba(0,0,0,0.05);
 | |
| }
 | |
| 
 | |
| 
 | |
| .editor .outline div[collapsed] {
 | |
| 	border-bottom: solid 1px silver;
 | |
| }
 | |
| .editor .outline div[collapsed] div {
 | |
| 	display: none;
 | |
| }
 | |
| 
 | |
| /* XXX are we selecting subtrees or blocks??? */
 | |
| .editor .outline [selected] {
 | |
| 	background: silver;
 | |
| }
 | |
| 
 | |
| 
 | |
| .editor .toolbar {
 | |
| 	display: inline-block;
 | |
| 	position: absolute; 
 | |
| 	top: 1em;
 | |
| 	right: 1em;
 | |
| }
 | |
| .editor .toolbar button {
 | |
| 	--margin: 0.1em;
 | |
| 
 | |
| 	display: block;
 | |
| 
 | |
| 	width: calc(var(--button-size) + var(--margin) * 2);
 | |
| 	height: var(--button-size);
 | |
| 	margin: var(--margin);
 | |
| 
 | |
| 	font-size: var(--button-size);
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 |