-
Notifications
You must be signed in to change notification settings - Fork 4
Add Checkbox 'Indeterminate' State styling #460
Conversation
Awesome, @modialpad thanks for PRing this. Glad to see you updated the documentation. I just pushed a quick update as well; my suggestion is we parse the indeterminate style out to its own discrete section. LMK what you think. Also, out of curiosity: is your local build looping when you save? |
Np, looks more organized now 👍 Yes, when I run |
No, that's not just you. I'm noticing that on my end as well; that's new. I already noted it. Only question I have is about the attribute. MDN suggests that browsers don't currently support |
docs/components/checkbox.html
Outdated
</div> | ||
<div class="d-checkbox-group"> | ||
<div class="d-checkbox__input"> | ||
<input class="d-checkbox" type="checkbox" name="Dialtone-CheckExample6" id="Dialtone-CheckExample6" indeterminate /> |
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.
I don't think this is valid. There is no indeterminate
attribute, you actually can ONLY set this through JS: https://css-tricks.com/indeterminate-checkboxes/
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.
dammit @dialpad-drew already beat me to it
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.
Done
@@ -169,6 +169,18 @@ | |||
background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z' fill='hsl(240, 10%, 51%)'/%3E%3C/svg%3E"); | |||
} | |||
} | |||
|
|||
&--indeterminate, | |||
&[indeterminate] { |
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.
as above, this is not an attribute. But there IS a CSS pseudo-class weirdly (if it's set via js) https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate
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.
Done
--check-radio--bgc: var(--check-radio--color); | ||
background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 13H5v-2h14v2z' fill='%23fff'/%3E%3C/svg%3E"); | ||
|
||
&[disabled] { |
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.
unrelated to your PR but I just noticed we aren't using the pseudo class for this either https://developer.mozilla.org/en-US/docs/Web/CSS/:disabled
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.
Yeah, the other PR I have adds the custom class for the disabled
state for accessibility reasons.
…ector - update docs
@dialpad-drew @dbecherdialpad I read the docs and you're right, browsers don't support |
@dbecherdialpad we probably don't need to update Also, another question I have is about the publish process. I assume I'll have to bump the version of Dialtone after this merge, is there documentation somewhere for this? (Finally, I can't seem to have merge permissions here. But we should probably go ahead and merge if it looks good) |
For dialtone-vue I generally prefer adding a prop (which adds the class) rather than relying on engineers to pass the correct class name. This also allows for improved autocomplete and documentation. For
Docs are here but it requires one of us to publish the version https://github.com/dialpad/dialtone/blob/staging/.github/RELEASING.md |
@modialpad In dialtone-vue this is actually quite trivial to add using the |
Great, thanks! I'll open the |
Description
Add Checkbox 'Indeterminate' state styles.
How it looks:
Pull Request Checklist
staging
as your pull request's base branch. (All PRs usingproduction
as its base branch will be declined).gulp
scripts successfully compile.