-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing RadioButton and Checkbox styles, solves #442 #299 #415 #489 #488 #508
Conversation
checked="{{checked}}" value="{{value}}" name="{{name}}"/> | ||
<template role="presentation"> | ||
|
||
<input class="d-reset" type="checkbox" attach-point="focusNode,valueNode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d-reset
set font, line-height and color. This looks not needed here if only padding and margin must be set. Same comment for radiobutton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oversight on my part.
The SVG fixes #442? That's nice, but IIUC the downside is that it breaks theme customizatio, i.e. you can't have different checkbox icons depending on theme, although perhaps you can control the color. |
SVG is fixing another positioning problem (reported in #408, which I forgot to mention)
When the checkbox was using DOM + a unicode character as a checkmark, it could be easily affected by a lot of CSS properties such as line-height, font-size, margins, padding... It was hard to make it look the same cross-browser (1px makes a huge difference at theses sizes) and was hurting the interoperability with bootstrap. Radiobutton is apprently much simpler an could be done only with DOM, but I wasn't satisfied with the way it looked at small sizes: the version below was implemented with DOM only in chrome. Part of my work on d-icon is see how we can have a different icon pack for each theme. This should solve your problem. |
Well, IIUC you are researching SVG, and you are a big fan of SVG, but we haven't actually decided to switch from font-icons to SVG. And even if we decide to switch, the end result won't look like what you have in this PR: you've hardcoded the icon into the widget's template, whereas ideally it should be part of the theme. I don't have a strong opinion, but not sure it makes sense to make this change now. |
Every single thing you said is true. i'm just exploring here... never meant to merge this, like dazzlingly stated in bold first post. If we ever decide to make the switch, the end result will look the same though, the markup will change, but no reason the stylesheet will. Strong opinion or not, please comment with it here #434 @dmandrioli I looked at it. I found that it's the border-radius set on the svg element that hiding part of the content, it'll be fixed. |
Ah right, sorry, you did write that. Well anyway, it's a good proof-of-concept of using SVG for these icons. I do think it would be easy to fix the alignment issues while still using font-icons, because it shouldn't be difficult to make one character align with other characters. Actually, that should happen naturally, assuming we aren't adding CSS that messes it up. |
ea71478
to
93584d3
Compare
- fixed labels positionning, solves #442 - fixed inconsistent outlines, solves #299 and #415 - fixed interop with bootstrap, solves #489 and #488 * fixed positioning inside .checkbox{,-inline} and .radio{,-inline} * added state dependant focus * using bootstrap variables for sizing, in the bootstrap theme NB: for now, removed holodark and ios themes for Checkbox. It doesn't exist for radio button.
NB: This is not ready for merge. It's only here to gather some feedback.before going further.
Additionally: