keyboard: text selection more or less ok

This commit is contained in:
jean-emmanuel 2022-10-29 23:34:12 +02:00
parent d607c1f447
commit 63e7a4fa5c
2 changed files with 121 additions and 50 deletions

View file

@ -46,19 +46,18 @@ osc-keyboard {
position: relative;
pointer-events: auto;
cursor: text;
span {
char {
margin: 0 0.25rem;
position: relative;
}
.newline + span:before, span:first-child:before {
.newline + char:before, char:first-child:before {
content: " ";
display: block;
position: absolute;
left: -100rem;
width: 100rem;
}
.newline:before, span:last-child:before {
.newline:before, char:last-child:before {
content: " ";
display: block;
position: absolute;
@ -78,6 +77,11 @@ osc-keyboard {
}
}
.select {
background: var(--color-accent);
box-shadow: 0 0 0 1rem var(--color-accent);
color: var(--color-background);
}
&.first-char-caret {
&:before {
content: "";
@ -100,9 +104,11 @@ osc-keyboard {
}
&:first-child {
height: 40rem;
overflow: hidden;
margin-bottom: var(--spacing);
}
}
.key {
key {
background: rgba(white, 0.05);
border-color: var(--color-ui-background);
flex: 1;
@ -151,7 +157,7 @@ osc-keyboard {
.sep {
display: none;
}
.sep ~ .key {
.sep ~ key {
flex-shrink: 0;
flex-grow: 0;
min-width: 5%;
@ -160,7 +166,7 @@ osc-keyboard {
}
&.shift {
.key {
key {
.display-shift {
display: flex;
}
@ -170,7 +176,7 @@ osc-keyboard {
}
}
@media screen and (max-width: 800px) {
.key {
key {
font-size: 80%
}
}