Skip to content

Commit 06b579a

Browse files
author
WebCoder49
committed
Fix some styling
1 parent c1b92f1 commit 06b579a

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

plugins/special-chars.css

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,40 @@
3333
position: relative;
3434
top: 0;
3535
left: 0;
36-
3736
height: 1em;
3837
/* width: set by JS */
39-
4038
text-decoration: none;
4139
text-shadow: none;
42-
4340
vertical-align: middle;
44-
45-
outline: 1px solid currentColor;
41+
outline: 0.1px solid currentColor;
4642
}
4743

4844
/* Default - Two bytes - 4 hex chars */
4945

5046
.code-input_special-char::before {
47+
margin-left: 50%;
48+
transform: translate(-50%, 0);
5149
content: " ";
52-
50+
5351
background-color: currentColor;
5452
image-rendering: pixelated;
5553
display: inline-block;
5654
width: calc(100%-2px);
5755
height: 100%;
5856

59-
--char-0: var(--code-input_special-chars_0);
60-
--char-1: var(--code-input_special-chars_1);
61-
--char-2: var(--code-input_special-chars_2);
62-
--char-3: var(--code-input_special-chars_3);
63-
64-
mask-image: var(--char-0), var(--char-1), var(--char-2), var(--char-3);
57+
--char-0: var(
58+
--code-input_special-chars_0);
59+
--char-1: var(
60+
--code-input_special-chars_1);
61+
--char-2: var(
62+
--code-input_special-chars_2);
63+
--char-3: var(
64+
--code-input_special-chars_3);
65+
mask-image: var(
66+
--char-0), var(--char-1), var(--char-2), var(--char-3);
6567
mask-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
6668
mask-size: 40%, 40%, 40%, 40%;
6769
mask-position: 10% 10%, 90% 10%, 10% 90%, 90% 90%;
68-
6970
-webkit-mask-image: var(--char-0), var(--char-1), var(--char-2), var(--char-3);
7071
-webkit-mask-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
7172
-webkit-mask-size: min(40%, 0.25em), min(40%, 0.25em), min(40%, 0.25em), min(40%, 0.25em);

plugins/special-chars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ codeInput.plugins.SpecialChars = class extends codeInput.Plugin {
1717
* @param {RegExp} specialCharRegExp The regular expression which matches special characters
1818
* @param {Boolean} colorInSpecialChars Whether or not to give special characters custom background colors based on their hex code
1919
*/
20-
constructor(specialCharRegExp = /(?!\n)(?!\t)[\u{0000}-\u{001F}]|[\u{007F}-\u{009F}]|[\u{0200}-\u{FFFF}]/ug, colorInSpecialChars = true) { // By default, covers many non-renderable ASCII characters
20+
constructor(specialCharRegExp = /(?!\n)(?!\t)[\u{0000}-\u{001F}]|[\u{007F}-\u{009F}]|[\u{0200}-\u{FFFF}]/ug, colorInSpecialChars = false) { // By default, covers many non-renderable ASCII characters
2121
super();
2222
this.specialCharRegExp = specialCharRegExp;
2323
this.colorInSpecialChars = colorInSpecialChars;

0 commit comments

Comments
 (0)