diff --git a/docs/index.html b/docs/index.html index 3f4bb2f..9c03302 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,15 +33,20 @@
I think it's
- +
- +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
diff --git a/radio-border-disabled.svg b/radio-border-disabled.svg new file mode 100644 index 0000000..fd003cd --- /dev/null +++ b/radio-border-disabled.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/radio-border.svg b/radio-border.svg new file mode 100644 index 0000000..633be90 --- /dev/null +++ b/radio-border.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/radio-dot-disabled.svg b/radio-dot-disabled.svg new file mode 100644 index 0000000..7d59f52 --- /dev/null +++ b/radio-dot-disabled.svg @@ -0,0 +1,3 @@ + + + diff --git a/radio-dot.svg b/radio-dot.svg new file mode 100644 index 0000000..61b884d --- /dev/null +++ b/radio-dot.svg @@ -0,0 +1,3 @@ + + + diff --git a/style.css b/style.css index ce0f54a..cb60bba 100644 --- a/style.css +++ b/style.css @@ -11,6 +11,7 @@ /* Spacing */ --element-spacing: 8px; --grouped-element-spacing: 4px; + --radio-label-spacing: 6px; /* Borders */ --border-width: 1px; @@ -169,3 +170,41 @@ legend { .field-row-stacked * + * { margin-top: var(--grouped-element-spacing); } + +label { + display: flex; + align-items: center; +} +input[type="radio"]:focus + label { + outline: 1px dotted #000000; +} +input[type="radio"] { + display: none; +} +input[type="radio"] + label { + position: relative; +} +input[type="radio"] + label::before { + content: ""; + display: inline-block; + width: 12px; + height: 12px; + margin-right: var(--radio-label-spacing); + background: url("./radio-border.svg"); +} +input[type="radio"]:checked + label::after { + content: ""; + display: block; + width: 4px; + height: 4px; + top: 4px; + left: 4px; + position: absolute; + background: url("./radio-dot.svg"); +} +input[type="radio"][disabled] + label::before { + background: url("./radio-border-disabled.svg"); +} +input[type="radio"][disabled]:checked + label::after { + background: url("./radio-dot-disabled.svg"); +}