Skip to content

Commit

Permalink
SWED-2336 style width radio.checkmark
Browse files Browse the repository at this point in the history
  • Loading branch information
goldenraphti committed Apr 19, 2024
1 parent a00d280 commit e189c2c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/less/components/radio.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@import "./form.less";
@import "../global.less";

// TODO: make sure checkmark still works if use <i> instead of span.checkmark-icon
// TODO: refactor it all, so it makes more sense

.radio {
--radio-height: 1.375rem;
--radio-width: var(--radio-height);
Expand Down Expand Up @@ -82,17 +85,14 @@
.radio.checkmark {
border: 2px solid transparent;
pointer-events: none;
width: var(--checkmark-width);
height: var(--checkmark-heigth);
width: auto;
height: auto;
margin: 0;

&.large {
height: 3.5rem;
}

&:not(:last-child) {
margin-inline-end: 8px;
}

&:active {
border: 2px solid transparent;
}
Expand All @@ -113,10 +113,10 @@
label {
outline: 1px solid var(--black);
border-radius: var(--border-radius, 8px);
margin: auto;
padding: 7px 1rem;
height: 100%;
width: 100%;
gap: 5px;
margin: 0;
gap: 1rem;
justify-content: center;

&:before {
Expand Down Expand Up @@ -193,6 +193,7 @@
input[type="radio"]:checked + label {
border-radius: var(--border-radius, 8px);
outline-width: 3px;
outline-offset: -2px;

// we're migrating from i to a pure CSS span.checkmark-icon. Keep <i> for now until next major release
i {
Expand All @@ -219,7 +220,6 @@
}

// we're migrating from i to a pure CSS span.checkmark-icon. Keep <i> for now until next major release
// FIXME: NOT TO BE HIDDEN. it should be displayed, but correctly styled
i {
visibility: hidden;
}
Expand All @@ -232,8 +232,6 @@
}

&:not(:checked) + label {
padding: 0;

i {
visibility: hidden;
display: none;
Expand Down Expand Up @@ -307,7 +305,6 @@ fieldset {

span {
font-weight: normal;
margin-inline-start: 0.2rem;
}
}

Expand Down

0 comments on commit e189c2c

Please sign in to comment.