Browser Support for Custom CSS3 Radio Buttons - css

So, I got my custom CSS3 Radio Buttons to work and they look great on my site. They're working in Firefox, and from what I've read, they should work in most modern browsers. However, on my phone (a Galaxy Nexus with Android 4.3), while they work perfectly in Chrome, they do not work on the default vanilla browser (not able to be clicked). I suspect there's also most likely problems in various versions of Internet Explorer (as there always seem to be).
I found a great article about browser support for custom radio buttons, but between all the marked out text and various updates, I can't figure out what exactly the problem is with my buttons & what the simplest solution is.
It seems to me that others might experience the same problem, so I've included my code in hopes that you can help me get to the bottom of this, and that this topic might point others in the right direction in the future. Thank you for your time.
Here's my code:
input[type=radio] {
display:none;
}
input[type=radio] + label:before {
content: "";
display: inline-block;
width: 15px;
height: 15px;
vertical-align:middle;
margin-right: 8px;
background-color: #aaa;
border-radius: 8px;
margin-top: -3.5px;
margin-left: 5%;
}
input[type=radio]:checked + label:before {
content: ""; /* just change color, no bullet */
background-color: #24bbff;
text-align:center;
line-height:14px;
}

I make this pen a while ago and works on android. http://codepen.io/karlprieb/pen/kKjCn
Edit the css for your design and test:
/* RADIO BUTTONS */
[type="radio"] {
visibility: hidden;
}
/* Radio button style */
[type="radio"]:not(:checked) + label,
[type="radio"]:checked + label {
position: relative;
padding-left: 20px;
margin-left: -20px;
cursor: pointer;
}
[type="radio"]:not(:checked) + label:before,
[type="radio"]:checked + label:before {
content: '';
position: absolute;
left:0; top: 0 ;
width: 13px; height: 13px;
border: 2px solid #cacaca;
background: #fff;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
}
/* Checked style */
[type="radio"]:not(:checked) + label:after,
[type="radio"]:checked + label:after {
content: '';
position: absolute;
top: 0; left: 0;
width: 17px;
height: 17px;
background: #82cdf5;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
transition: all .2s;
}
/* checked mark aspect changes */
[type="radio"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
[type="radio"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
/* Label hover style */
label:hover:before {
border: 2px solid #82cdf5!important;
}

Custom check box
// Check box
.check-large[type="checkbox"]:checked::-ms-check {
border: 2px solid #aaa;
color: #aaa;
opacity: 1;
font-size: larger;
}
.check-large[type="checkbox"] {
/* remove standard background appearance */
-webkit-appearance: none;
-moz-appearance: none;
/* create custom checkbox appearance */
display: inline-block;
width: 22px;
height: 22px;
padding: 4px;
/* background-color only for content */
background-clip: content-box;
border: 2px solid #000000;
opacity: 0.4;
vertical-align: bottom;
}
/* appearance for checked Checkbox */
.check-large[type="checkbox"]:checked , .check-large[type="checkbox"]:disabled:checked{
background-color: #aaa;
border: 2px solid #aaa;
opacity: 1;
}
<input type="checkbox" class="check-large">
<input type="checkbox" class="check-large">
// Radio Button
.radio-large[type="radio"]:checked::-ms-check {
border: 2px solid #aaa;
color: #aaa;
opacity: 1;
font-size: larger;
}
.radio-large[type="radio"] {
/* remove standard background appearance */
-webkit-appearance: none;
-moz-appearance: none;
/* create custom radiobutton appearance */
display: inline-block;
width: 22px;
height: 22px;
padding: 4px;
/* background-color only for content */
background-clip: content-box;
border: 2px solid #000000;
opacity: 0.4;
vertical-align: bottom;
border-radius:50%;
}
/* appearance for checked Radio button */
.radio-large[type="radio"]:checked , .radio-large[type="radio"]:disabled:checked{
background-color: #aaa;
border: 2px solid #aaa;
opacity: 1;
}
<input type="radio" name="radio-check" selected='selected' class="radio-large" >
<input type="radio" name="radio-check" class="radio-large" >
This can be used for the custom radio and checkbox creation.

Related

Cordova Platform Specific CSS

I have an app made in cord. I only used it for android now I decided to test it for IOS and I noticed these CSS errors.
How do I fix these errors that appear only in the IOS app?
if it is useful, I will post my css files below.
Do you have to add a hack to css to be interpreted by IOS?
IMPUTS
.form-group {
background-color: white;
padding: 5px;
margin-bottom: 15px;
border-bottom: 1px solid #a7a7a7;
border-radius: 1px;
height: 47px;
}
.form-group label {
display: inline-block;
margin-bottom: 7px;
float: left;
font-size: 14px;
}
.form-group input[type=text],input[type=password],input[type=number],select,textarea {
width: 100%;
border: 0px;
font-weight: 600;
font-size: 17px;
background-color: white;
text-transform: uppercase;
outline: none;
}
.form-group input[type=date],input[type=datetime-local] {
width: 100%;
border: 0px;
font-weight: 600;
font-size: 17px;
background-color: white;
text-transform: uppercase;
outline: none;
}
*:focus {
outline: none;
}
checkbox.css
input[type=checkbox] {
position: relative;
cursor: pointer;
margin: 0 13px 10px 0;
}
input[type=checkbox]:before {
content: "";
display: block;
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
background-color:#FFF;
border: solid 1px #CCC;
}
input[type=checkbox]:checked:before {
content: "";
display: block;
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
background-color:#1E80EF;
}
input[type=checkbox]:checked:after {
content: "";
display: block;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
top: 3px;
left: 8px;
}
radio.css
.form-group-radio {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.form-group-radio span {
float: left;
}
/* Hide the browser's default radio button */
.form-group-radio input {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Create a custom radio button */
.form-group-radio .checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
border-radius: 50%;
}
/* On mouse-over, add a grey background color */
.form-group-radio:hover input ~ .checkmark {
background-color: #ccc;
}
/* When the radio button is checked, add a blue background */
.form-group-radio input:checked ~ .checkmark {
background-color: #2196F3;
}
/* Create the indicator (the dot/circle - hidden when not checked) */
.form-group-radio .checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the indicator (dot/circle) when checked */
.form-group-radio input:checked ~ .checkmark:after {
display: block;
}
/* Style the indicator (dot/circle) */
.form-group-radio .checkmark:after {
top: 9px;
left: 9px;
width: 8px;
height: 8px;
border-radius: 50%;
background: white;
}
I won't go through your code because it's too much of a guess. My advice to you is always develop using chrome, then test again in Safari. You will find that Safari does not support/respect everything that Chrome does, css wise.
For instance, iOS webview has a hard time with flex box or even sticky. Lots of patching for Safari needed. So your code might be legit but iOS webview won't support it fully.
You can also detect with cordova what platform you are running (device.platform) then you can add a .ios class to your body and patch via the .ios class

Custom style checkbox using CSS (no bootstrap) [duplicate]

This question already has answers here:
How to style a checkbox using CSS
(43 answers)
Closed 7 months ago.
How do you style checkbox using only CSS? I want checkboxes with a background color of my choice, and appear a cross mark when they are checked, instead of a checkmark.
/* Base for label styling */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
position: relative;
padding-left: 1.95em;
cursor: pointer;
}
/* checkbox aspect */
[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left: 0; top: 0;
width: 1.25em; height: 1.25em;
border: 2px solid #ccc;
background: #fff;
border-radius: 4px;
box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
}
/* checked mark aspect */
[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
content: '✔';
position: absolute;
top: .1em; left: .3em;
font-size: 1.3em;
line-height: 0.8;
color: #09ad7e;
transition: all .2s;
}
/* checked mark aspect changes */
[type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
[type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
/* disabled checkbox */
[type="checkbox"]:disabled:not(:checked) + label:before,
[type="checkbox"]:disabled:checked + label:before {
box-shadow: none;
border-color: #bbb;
background-color: #ddd;
}
[type="checkbox"]:disabled:checked + label:after {
color: #999;
}
[type="checkbox"]:disabled + label {
color: #aaa;
}
/* accessibility */
[type="checkbox"]:checked:focus + label:before,
[type="checkbox"]:not(:checked):focus + label:before {
border: 2px dotted blue;
}
/* hover style just for information */
label:hover:before {
border: 2px solid #4778d9!important;
}
body {
font-family: "Open sans", "Segoe UI", "Segoe WP", Helvetica, Arial, sans-serif;
color: #777;
}
h1, h2 {
margin-bottom: .25em;
font-weight: normal;
text-align: center;
}
h2 {
margin: .25em 0 2em;
color: #aaa;
}
form {
width: 7em;
margin: 0 auto;
}
.txtcenter {
margin-top: 4em;
font-size: .9em;
text-align: center;
color: #aaa;
}
.copy {
margin-top: 2em;
}
.copy a {
text-decoration: none;
color: #4778d9;
}
<form action="#">
<p>
<input type="checkbox" id="test1" />
<label for="test1">India</label>
</p>
<p>
<input type="checkbox" id="test2" checked="checked" />
<label for="test2">USA</label>
</p>
<p>
<input type="checkbox" id="test3" checked="checked" />
<label for="test3">Japan</label>
</p>
</form>
<div class="checkbox">
<input name="filter_price0" id="offer_407" type="checkbox" value="407" hidden >
<label for="offer_407">
Below 500 Rs
</label>
</div>
<style>
.checkbox input[type="checkbox"]:checked + label:before {
background-color: #424242;
border-color: #424242;
content: "\2713";
display: inline-block;
text-align: center;
color:#fff;
}
li{
list-style-type:none;
margin-top:10px;
}
.checkbox label{
cursor:pointer;
}
.checkbox label:before {
content: "";
cursor:pointer;
display: inline-block;
position: absolute;
width: 20px;
height: 20px;
left: 0;
border: 1px solid #cccccc;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}
</style>
for demo you can click here fiddle demo, and next time post some code which you tryed
Had the same question - found a nice solution - check out answers in Stackoverflow - no one has this one nice trick.
Here it is
input[type=checkbox].agb {
all: unset;
/* rest of styles here */
}
It sets all Browser generated css styles to none and you are able to style the checkbox from scratch like you want to have it without any label hacks or something.
Cool?
I'll give you an example of a simple custom checkbox of mine.
input[type=checkbox].agb {
all: unset;
width: 32px;
height: 32px;
margin-right: 5px;
display: block;
background: var(--color-2);
float: left;
}
input[type=checkbox].agb:checked {
background: var(--color-4);
color: var(--color-2)
}
input[type=checkbox].agb:checked::after {
content: "✔";
display: block;
font-size: 26px;
padding-left: 5px;
}

css checkbox style for border color [duplicate]

This question already has answers here:
How to change checkbox's border style in CSS?
(15 answers)
Closed 6 years ago.
I have a check box in my table.
this is css of that checkbox
input[type="checkbox"] {
width: 20px;
height: 30px;
margin: auto;
display: table-row;
border: 5px solid red;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
margin-left: 4px;
margin-top: 1px;
}
but it shows normal checkbox.
I want to change the border color of that checkbox.
but it doesn't work!!!
You can put only below css for checkbox border and see Fiddle Demo
CSS:
.error input[type=checkbox] {
outline: 2px solid #c00;
}
Try this customized the checkbox code:
/* Remove default checkbox */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
position: relative;
overflow: hidden;
padding-left: 35px;
cursor: pointer;
display: inline-block;
height: 25px;
line-height: 25px;
-webkit-user-select: none; /* webkit (safari, chrome) browsers */
-moz-user-select: none; /* mozilla browsers */
-khtml-user-select: none; /* webkit (konqueror) browsers */
-ms-user-select: none; /* IE10+ */
}
/* checkbox aspect */
[type="checkbox"] + label:before,
[type="checkbox"] + label:after {
content: '';
position: absolute;
left: 0;
z-index: 1;
-webkit-transition: .2s;
transition: .2s;
}
/* Unchecked styles */
[type="checkbox"]:not(:checked) + label:before {
top: 0px;
width: 19px; height: 19px;
border: 1px solid red;
}
[type="checkbox"]:not(:checked) + label:after {
top: 0px;
width: 19px; height: 19px;
border: 1px solid red;
z-index: 0;
}
/* Checked styles */
[type="checkbox"]:checked + label:before {
top: 2px;
width: 6px; height: 12px;
border-top: 1px solid transparent;
border-left: 1px solid transparent;
border-right: 1px solid red;
border-bottom: 1px solid red;
-webkit-transform: rotateZ(37deg);
transform: rotateZ(37deg);
-webkit-transform-origin: 20% 40%;
transform-origin: 100% 100%;
}
[type="checkbox"]:checked + label:after {
top: 0px;
width: 19px; height: 19px;
border: 1px solid red;
z-index: 0;
}
/* disabled checkbox */
[type="checkbox"]:disabled:not(:checked) + label:before,
[type="checkbox"]:disabled:checked + label:before {
top: 0;
box-shadow: none;
background-color: #444;
width: 19px; height: 19px;
border: 3px solid #444;
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
[type="checkbox"]:disabled + label {
color: #555;
}
[type="checkbox"]:disabled:not(:checked) + label:hover:before {
border-color: red;
}
<form action="#">
<p>
<input type="checkbox" id="test1" />
<label for="test1">Red</label>
</p>
<p>
<input type="checkbox" id="test2" checked="checked" />
<label for="test2">Yellow</label>
</p>
</form>
I guess HTML does not allow adding border styles to check boxes. Try using the outline property instead.

how can i add to rectangle with arrows border [duplicate]

I would like to make a button like these one just with CSS without using another element.
Button Image
Since the button has a border attached, I think I normally need both, the :before and :after elements to create just one arrow at one side. So to make one arrow at each side I would need another span element inside the link.
The second method I tried is the one you see below. But with this solution they are not properly centered and each side of the arrow is different in length.
Has someone a solution?
/* General Button Style */
.button {
display: block;
position: relative;
background: #fff;
width: 300px;
height: 80px;
line-height: 80px;
text-align: center;
font-size: 20px;
text-decoration: none;
text-transform: uppercase;
color: #e04e5e;
margin: 40px auto;
font-family: Helvetica, Arial, sans-serif;
box-sizing: border-box;
}
/* Button Border Style */
.button.border {
border: 4px solid #e04e5e;
}
.button.border:hover {
background: #e04e5e;
color: #fff;
}
/* Button Ribbon-Outset Border Style */
.button.ribbon-outset.border:after,
.button.ribbon-outset.border:before {
top: 50%;
content: " ";
height: 43px;
width: 43px;
position: absolute;
pointer-events: none;
background: #fff;
}
.button.ribbon-outset.border:after {
left: -3px;
margin-top: -40px;
transform-origin: 0 0;
box-sizing: border-box;
border-bottom: 4px solid #e04e5e;
border-left: 4px solid #e04e5e;
transform: rotate(57.5deg) skew(30deg);
}
.button.ribbon-outset.border:before {
right: -46px;
margin-top: -40px;
transform-origin: 0 0;
box-sizing: border-box;
border-top: 4px solid #e04e5e;
border-right: 4px solid #e04e5e;
transform: rotate(57.5deg) skew(30deg);
}
.button.ribbon-outset.border:hover:after {
background: #e04e5e
}
.button.ribbon-outset.border:hover:before {
background: #e04e5e
}
Click me!
CodePen Demo
Here is another alternate way to get this done with only one element.
This approach works like below:
Two pseudo-elements :before and :after which are about half the size (including borders) of the main .button element. The height of each pseudo-element is 34px + 4px border on one side (top/bottom) and 2px on the other side.
The top half of the shape is achieved using the :before element whereas the bottom half is achieved using the :after element.
Using a rotateX with perspective to achieve the tilted effect and positioning to place the two elements such that they form the expected shape.
/* General Button Style */
.button {
position: relative;
display: block;
background: transparent;
width: 300px;
height: 80px;
line-height: 80px;
text-align: center;
font-size: 20px;
text-decoration: none;
text-transform: uppercase;
color: #e04e5e;
margin: 40px auto;
font-family: Helvetica, Arial, sans-serif;
box-sizing: border-box;
}
.button:before,
.button:after {
position: absolute;
content: '';
width: 300px;
left: 0px;
height: 34px;
z-index: -1;
}
.button:before {
transform: perspective(15px) rotateX(3deg);
}
.button:after {
top: 40px;
transform: perspective(15px) rotateX(-3deg);
}
/* Button Border Style */
.button.border:before,
.button.border:after {
border: 4px solid #e04e5e;
}
.button.border:before {
border-bottom: none; /* to prevent the border-line showing up in the middle of the shape */
}
.button.border:after {
border-top: none; /* to prevent the border-line showing up in the middle of the shape */
}
/* Button hover styles */
.button.border:hover:before,
.button.border:hover:after {
background: #e04e5e;
}
.button.border:hover {
color: #fff;
}
<!-- Library included to avoid browser prefixes -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
Click me!
Fixed Width Demo | Dynamic Width Demo
Output Screenshot:
This is tested in Chrome v24+, Firefox v19+, Opera v23+, Safari v5.1.7, IE v10.
As-is, this would degrade quite well in IE 8 and IE 9 into a square button with borders. However, due to the nullification of one border (border-bottom for :before and border-top for :after) it would leave a white area (resembling a strike-through line) in the middle. This can be overcome by adding a couple of IE < 10 specific styles using conditional comments like in this demo.
<!--[if IE]>
<style>
.button.border:after{
top: 38px;
}
.button.border:hover:before, .button.border:hover:after {
border-bottom: 4px solid #e04e5e;
}
</style>
<![endif]-->
Output Screenshot from IE 9 and IE 8:
This is just a simpler alternative to Harry's answer.
This approach uses scale() and rotate(45deg) transforms. Using this approach, you can very easily change the angle of right and left chevrons.
Fiddle
div {
height: 70px;
width: 200px;
margin-left: 40px;
border-top: 4px solid #E04E5E;
border-bottom: 4px solid #E04E5E;
position: relative;
text-align: center;
color: #E04E5E;
line-height: 70px;
font-size: 21px;
font-family: sans-serif;
}
div:before, div:after {
content:'';
position: absolute;
top: 13px;
height: 40px;
width: 40px;
border: 4px solid #E04E5E;
-webkit-transform: scale(0.8,1.25) rotate(45deg);
-moz-transform: scale(0.8,1.25) rotate(45deg);
-ms-transform: scale(0.8,1.25) rotate(45deg);
transform: scale(0.8,1.25) rotate(45deg);
}
div:before {
left: -22px;
border-top: 0px solid transparent;
border-right: 0px solid transparent;
}
div:after {
right: -22px;
border-bottom: 0px solid transparent;
border-left: 0px solid transparent;
}
div:hover, div:hover:before, div:hover:after {
background-color: #E04E5E;
color: #EEE;
}
<div>HELLO!</div>
Want a wider arrow? Simply decrease scale() transform's x value : Fiddle (wide)
Narrower one? Increase scale() transform's x value : Fiddle (narrow)
Note: IE 8 and below don't support CSS Transforms (9 supports with -ms- prefix), so you can check out this site for supporting them: IE Transform Translator
I forked your Pen
Codepen Demo
The essential changes are that I removed the side borders from the main button (as they were superflous
/* Button Border Style */
.button.border {
border-top: 4px solid #e04e5e;
border-bottom: 4px solid #e04e5e;
}
and changed a couple of values to tweak it all into place
/* Button Ribbon-Outset Border Style */
.button.ribbon-outset.border:after,
.button.ribbon-outset.border:before {
top: 50%;
content: " ";
height: 43px;
width: 43px;
position: absolute;
pointer-events: none;
}
.button.ribbon-outset.border:after {
left:0;
margin-top:-40px;
transform-origin:0 0;
box-sizing:border-box;
border-bottom:4px solid #e04e5e;
border-left:4px solid #e04e5e;
transform:rotate(57.5deg) skew(30deg);
}
.button.ribbon-outset.border:before {
right:-43px;
margin-top:-40px;
transform-origin:0 0;
box-sizing:border-box;
border-top:4px solid #e04e5e;
border-right:4px solid #e04e5e;
transform:rotate(57.5deg) skew(30deg);
}
I got the answer myself. It was a problem of the transform property of the :before and :after elements.
CSS changed:
/* Button Border Style */
.button.border {
border-top:4px solid #e04e5e;
border-bottom:4px solid #e04e5e;
}
/* Button Ribbon-Outset Border Style */
.button.ribbon-outset.border:after, .button.ribbon-outset.border:before {
height: 42px;
width: 42px;
}
.button.ribbon-outset.border:after {
left:0;
border-bottom:5px solid #e04e5e;
border-left:5px solid #e04e5e;
transform:rotate(45deg) skew(19deg,19deg);
}
.button.ribbon-outset.border:before {
right:-42px;
border-top:5px solid #e04e5e;
border-right:5px solid #e04e5e;
transform:rotate(45deg) skew(19deg,19deg);
}
Updated Codepen

How to override BootStrap CSS checkboxs and input checkboxs

I am having a problem over-riding the bootstrap css for checkboxes and input checkboxes. I have a checkboxlist and the bootstraps styling is over-riding my own css file. I have doubled checked and made sure that it wasn't bootstraps themes causing the issue but it is the bootstraps css.
I have also tried using !important
in my css and it still gets over-ridden, I even placed my css file after the bootstraps css, tried putting my css before it, even tried
input[type=checkbox]
and that did nothing as well.
Here is the css I'm trying to use to override the bootstrap
.CheckBoxSubjects td {
border-style: solid;
border: 1px solid #78E389;
width: 122px;
height: 27px;
border-radius: 5px;
background-color:#78E389;
}
Here's the fiddle of the code I used. Hope this helps for you.
http://jsfiddle.net/cLaty/
HTML
<div class="checkbox pull-right">
<input type="checkbox" id="remember" /><label for="remember">Remember me</label>
</div>
CSS
input[type="checkbox"]:not(:checked),
input[type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
input[type="checkbox"]:not(:checked) + label,
input[type="checkbox"]:checked + label {
position: relative;
padding-left: 25px;
cursor: pointer;
}
/* checkbox aspect */
input[type="checkbox"]:not(:checked) + label:before,
input[type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left:0; top: 2px;
width: 17px; height: 17px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 3px;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
/* checked mark aspect */
input[type="checkbox"]:not(:checked) + label:after,
input[type="checkbox"]:checked + label:after {
content: '✔';
position: absolute;
top: 0; left: 4px;
font-size: 14px;
color: #4cc0c1;
transition: all .2s;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
}
/* checked mark aspect changes */
input[type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
input[type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
/* disabled checkbox */
input[type="checkbox"]:disabled:not(:checked) + label:before,
input[type="checkbox"]:disabled:checked + label:before {
box-shadow: none;
border-color: #999999;
background-color: #ddd;
}
input[type="checkbox"]:disabled:checked + label:after {
color: #999;
}
input[type="checkbox"]:disabled + label {
color: #aaa;
}
/* accessibility */
input[type="checkbox"]:checked:focus + label:before,
input[type="checkbox"]:not(:checked):focus + label:before {
border: inherit;
}

Resources