Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

label-first attribute #100

Open
wants to merge 2 commits 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
17 changes: 16 additions & 1 deletion paper-radio-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
position: relative;
display: inline-block;
vertical-align: middle;
margin-left: var(--paper-radio-button-label-spacing, 10px);
margin: 0 var(--paper-radio-button-label-spacing, 5px);
white-space: normal;
color: var(--paper-radio-button-label-color, --primary-text-color);
}
Expand Down Expand Up @@ -166,10 +166,17 @@
}
</style>

<template is="dom-if" if="[[labelFirst]]">
<div id="radioLabel"><content></content></div>
</template>
<div id="radioContainer">
<div id="offRadio"></div>
<div id="onRadio"></div>
</div>
<template is="dom-if" if="[[!labelFirst]]">
<div id="radioLabel"><content></content></div>
</template>
</template>

<div id="radioLabel"><content></content></div>
</template>
Expand Down Expand Up @@ -204,6 +211,14 @@
ariaActiveAttribute: {
type: String,
value: 'aria-checked'
},

/**
* If true the label content is inserted previous the button element
*/
labelFirst: {
type: Boolean,
value: false
}
},

Expand Down