Skip to content
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

Fixes #103 Remove width of checkbox from label #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions paper-checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
white-space: normal;
line-height: normal;
color: var(--paper-checkbox-label-color, var(--primary-text-color));
width: calc(100% - var(--paper-checkbox-size) - var(--paper-checkbox-label-spacing));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--paper-checkbox-size -> --calculated-paper-checkbox-size
var(--paper-checkbox-label-spacing) -> var(--paper-checkbox-label-spacing, 8px)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, slight hiccup here: this change prevents you from using 0 for --paper-checkbox-label-spacing if you're trying to clear the styling so you can use an external label, which I suspect is a relatively common case. Particularly, you can't add lengths (which have units) and unitless values with calc(). Also, you can't multiply two or more values having units, as the result would have units which aren't lengths; so multiplying by 1px or something to get around this is out. :/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @danbeam

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, after reading the CSS values spec, this appears to be a bug in the implementation of calc() that happens to exist in all of Chrome / Firefox / Safari. (I haven't tried out Edge yet.) Filed as https://bugs.chromium.org/p/chromium/issues/detail?id=641556

@apply(--paper-checkbox-label);
}

Expand Down