public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [PATCH yew-widget-toolkit-assets] input: align check boxes better in forms
Date: Mon,  9 Mar 2026 09:41:21 +0100	[thread overview]
Message-ID: <20260309084121.17412-1-s.sterz@proxmox.com> (raw)

by applying a negative margin to the left and right sides. this is
necessary, as we apply a background-color when the checkbox is, for
exampled, hovered. if we just applied the padding to the bottom and
top, that background would appear as an oval due to the way
`border-radius: 50%` works on non-square elements.

the negative margin preserves the square shape of the element while
essentially removing the extra space added by the padding property.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 scss/_input.scss | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scss/_input.scss b/scss/_input.scss
index 293717c..3644043 100644
--- a/scss/_input.scss
+++ b/scss/_input.scss
@@ -187,7 +187,9 @@ input {
     @include accent-color-scheme-vars($default-accent-color);

     display: inline-block;
-    padding: max(map-get($line-height, "label-large") - map-get($font-size, "label-large"), var(--pwt-spacer-1));
+    $pwt-checkbox-state-padding: max(map-get($line-height, "label-large") - map-get($font-size, "label-large"), var(--pwt-spacer-1));
+    padding: $pwt-checkbox-state-padding;
+    margin: auto calc(-1 * $pwt-checkbox-state-padding);
     border-radius: 50%;
     transition: background 0.3s;

--
2.47.3





             reply	other threads:[~2026-03-09  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09  8:41 Shannon Sterz [this message]
2026-03-09  9:31 ` applied: " Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260309084121.17412-1-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=yew-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal