Skip to content

Commit

Permalink
improve the radioitem
Browse files Browse the repository at this point in the history
  • Loading branch information
yilinxia committed Feb 12, 2025
1 parent 8d97f62 commit 216ab02
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
app.layout = layout

if __name__ == "__main__":
app.run(host="0.0.0.0", port=8050, debug=False)
app.run(host="0.0.0.0", port=8050, debug=True)

47 changes: 47 additions & 0 deletions assets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,51 @@
.hover-button.selected {
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.5);
/* A stronger shadow effect */
}

/* 1) Remove the default radio styling */
input[type="radio"] {
appearance: none;
/* For Chrome/Safari/Edge */
-moz-appearance: none;
/* For Firefox */
-webkit-appearance: none;
/* For older Safari/Chrome */

/* 2) Size and shape */
width: 20px;
height: 20px;
border: 2px solid #505050;
/* Unchecked outer ring (black) */
border-radius: 50%;
/* Make it a circle */
cursor: pointer;
position: relative;
/* So we can absolutely position the fill */
margin-right: 8px;
/* Spacing between the radio and label */
vertical-align: middle;
/* Keep it aligned with text */
}

/* 3) When checked, change the outer ring’s color */
input[type="radio"]:checked {
border-color: #0064f7;
/* Purple border when checked */
}

/* 4) Add the inner fill for the checked state using a pseudo-element */
input[type="radio"]:checked::before {
content: "";
position: absolute;
top: 3px;
/* Centers the circle vertically */
left: 3px;
/* Centers the circle horizontally */
width: 10px;
/* Inner circle’s diameter */
height: 10px;
background: #ffffff;
border-radius: 50%;
/* Make it a circle */
}

0 comments on commit 216ab02

Please sign in to comment.