This repository was archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
paper-checkbox-light #145
Open
bicknellr
wants to merge
7
commits into
master
Choose a base branch
from
paper-checkbox-light
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
paper-checkbox-light #145
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d38cacc
copy from paper-checkbox
bicknellr 3a14255
paper-checkbox-light
bicknellr 6b3cacb
update bower.json; update tabIndex and pointer-events for disabled state
bicknellr 3448bff
fix bug with animation when style scoping class changes
bicknellr 7e5af9d
move event listeners after next render
bicknellr b42d8e0
keep the ripple visible when using the keyboard to toggle
bicknellr a21ab4b
remove method syntax
bicknellr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<!doctype html> | ||
<!-- | ||
@license | ||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
<html> | ||
<head> | ||
<title>paper-checkbox-light demo</title> | ||
|
||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
|
||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> | ||
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> | ||
<link rel="import" href="../paper-checkbox-light.html"> | ||
|
||
<style is="custom-style" include="demo-pages-shared-styles"> | ||
paper-checkbox-light { | ||
display: block; | ||
margin: 12px; | ||
} | ||
|
||
demo-snippet { | ||
margin-bottom: 40px; | ||
} | ||
.vertical-section-container { | ||
max-width: 550px; | ||
} | ||
</style> | ||
</head> | ||
<body unresolved> | ||
<div class="vertical-section-container centered"> | ||
<h3>Checkboxes can be checked or unchecked, or disabled entirely</h3> | ||
<demo-snippet class="centered-demo"> | ||
<template> | ||
<paper-checkbox-light></paper-checkbox-light> | ||
<paper-checkbox-light checked></paper-checkbox-light> | ||
<paper-checkbox-light disabled></paper-checkbox-light> | ||
</template> | ||
</demo-snippet> | ||
|
||
<h3>Checkboxes can hide the ripple effect using the <i>noink</i> attribute</h3> | ||
<demo-snippet class="centered-demo"> | ||
<template> | ||
<paper-checkbox-light noink></paper-checkbox-light> | ||
</template> | ||
</demo-snippet> | ||
|
||
<h3> | ||
Use ARIA attributes (such as <code>aria-label</code>) to provide an | ||
accessible description of the checkbox to the user.<br> | ||
Checkboxes can be styled using custom properties. | ||
</h3> | ||
<demo-snippet class="centered-demo small-text"> | ||
<template> | ||
<style is="custom-style"> | ||
.checkbox-wrapper { | ||
display: flex; | ||
padding: 8px 16px; | ||
} | ||
|
||
.checkbox-wrapper.align-center { | ||
align-items: center; | ||
} | ||
|
||
.checkbox-wrapper paper-checkbox-light { | ||
margin: 8px 16px 8px 0; | ||
} | ||
|
||
.checkbox-wrapper .subtitle { | ||
display: block; | ||
font-size: 0.8em; | ||
margin-top: 2px; | ||
max-width: 150px; | ||
} | ||
|
||
.checkbox-wrapper.red { | ||
color: var(--paper-red-500); | ||
} | ||
|
||
.checkbox-wrapper.red paper-checkbox-light { | ||
--paper-checkbox-checked-color: var(--paper-red-500); | ||
--paper-checkbox-checked-ink-color: var(--paper-red-500); | ||
--paper-checkbox-unchecked-color: var(--paper-red-900); | ||
--paper-checkbox-unchecked-ink-color: var(--paper-red-900); | ||
--paper-checkbox-vertical-align: top; | ||
} | ||
|
||
.checkbox-wrapper.green { | ||
border: 1px solid var(--paper-green-200); | ||
color: var(--paper-green-500); | ||
} | ||
|
||
.checkbox-wrapper.green paper-checkbox-light { | ||
--paper-checkbox-checked-color: var(--paper-green-500); | ||
--paper-checkbox-checked-ink-color: var(--paper-green-500); | ||
--paper-checkbox-unchecked-color: var(--paper-green-900); | ||
--paper-checkbox-unchecked-ink-color: var(--paper-green-900); | ||
--paper-checkbox-vertical-align: top; | ||
} | ||
|
||
.checkbox-wrapper.blue { | ||
color: var(--paper-blue-500); | ||
} | ||
|
||
.checkbox-wrapper.blue paper-checkbox-light { | ||
--paper-checkbox-checked-color: var(--paper-blue-500); | ||
--paper-checkbox-checked-ink-color: var(--paper-blue-500); | ||
--paper-checkbox-unchecked-color: var(--paper-blue-900); | ||
--paper-checkbox-unchecked-ink-color: var(--paper-blue-900); | ||
} | ||
</style> | ||
|
||
<div class="checkbox-wrapper align-center red"> | ||
<paper-checkbox-light aria-label="A red checkbox"></paper-checkbox-light> | ||
<div> | ||
A red checkbox | ||
</div> | ||
</div> | ||
<div class="checkbox-wrapper green"> | ||
<paper-checkbox-light checked aria-labelledby="label-green"></paper-checkbox-light> | ||
<div> | ||
<span id="label-green">A green checkbox</span> | ||
<span class="subtitle"> | ||
with a subtitle that wraps to a few lines because that's what | ||
happens when it's so long | ||
</span> | ||
</div> | ||
</div> | ||
<div class="checkbox-wrapper align-center blue"> | ||
<paper-checkbox-light aria-labelledby="label-blue"></paper-checkbox-light> | ||
<div> | ||
<span id="label-blue">A blue checkbox</span> | ||
<span class="subtitle"> | ||
with a subtitle that's also really long but the checkbox is | ||
center aligned | ||
</span> | ||
</div> | ||
</div> | ||
</template> | ||
</demo-snippet> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 would also add a demo for "what should you do if you want a label"
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.
Actually, I would also bring back the subtitle examples, but with flexbox or whatever you need. Maybe just have a section "Checkboxes with labels", and do a bunch of examples? Like single line, multi-line-align-top, multi-line-align-center?
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.
Ok, I added them back.