Merge remote-tracking branch 'origin/master'

This commit is contained in:
FezVrasta 2014-09-17 08:18:16 +02:00
commit 30dc821ca4
10 changed files with 230 additions and 40 deletions

View File

@ -8,6 +8,12 @@ This theme is in early developement and is not ready for production.
Check out [the demo at this link](http://fezvrasta.github.io/bootstrap-material-design/). Check out [the demo at this link](http://fezvrasta.github.io/bootstrap-material-design/).
## How to install
bower install bootstrap-material-design --save
## Features
Currently supported elements: Currently supported elements:

26
bower.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "Material Design for Bootstrap",
"version": "0.0.8",
"homepage": "http://fezvrasta.github.io/bootstrap-material-design",
"authors": [
"Federico Zivolo <info@mywebexpression.com>"
],
"description": "Material Design theme for Bootstrap 3",
"main": "css-compiled/material.css",
"keywords": [
"material",
"design",
"bootstrap",
"theme",
"google",
"android"
],
"license": "https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

View File

@ -1,4 +1,4 @@
/* Generated by less 1.7.0 */ /* Generated by less 1.7.5 */
@import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,700,300|Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic); @import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,700,300|Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic);
@-webkit-keyframes input-highlight { @-webkit-keyframes input-highlight {
0% { 0% {
@ -536,8 +536,8 @@ h6,
} }
.checkbox input[type=checkbox] ~ .check { .checkbox input[type=checkbox] ~ .check {
position: absolute; position: absolute;
top: 0px; top: 2px;
left: 0px; left: 11px;
width: 18px; width: 18px;
height: 18px; height: 18px;
border: solid 2px; border: solid 2px;
@ -1173,11 +1173,15 @@ h6,
.radio input[type=radio][disabled] ~ .check { .radio input[type=radio][disabled] ~ .check {
background-color: rgba(0, 0, 0, 0.84); background-color: rgba(0, 0, 0, 0.84);
} }
fieldset[disabled] .form-control,
.form-control-wrapper .form-control, .form-control-wrapper .form-control,
.form-control, .form-control,
fieldset[disabled] .form-control:focus,
.form-control-wrapper .form-control:focus, .form-control-wrapper .form-control:focus,
.form-control:focus { .form-control:focus,
height: 28px; fieldset[disabled] .form-control.focus,
.form-control-wrapper .form-control.focus,
.form-control.focus {
padding: 0; padding: 0;
float: none; float: none;
border: 0; border: 0;
@ -1186,24 +1190,42 @@ h6,
background: transparent; background: transparent;
border-bottom: 1px solid #757575; border-bottom: 1px solid #757575;
} }
fieldset[disabled] .form-control:not(textarea):not(select),
.form-control-wrapper .form-control:not(textarea):not(select),
.form-control:not(textarea):not(select),
fieldset[disabled] .form-control:focus:not(textarea):not(select),
.form-control-wrapper .form-control:focus:not(textarea):not(select),
.form-control:focus:not(textarea):not(select),
fieldset[disabled] .form-control.focus:not(textarea):not(select),
.form-control-wrapper .form-control.focus:not(textarea):not(select),
.form-control.focus:not(textarea):not(select) {
height: 28px;
}
fieldset[disabled] .form-control:disabled,
.form-control-wrapper .form-control:disabled, .form-control-wrapper .form-control:disabled,
.form-control:disabled, .form-control:disabled,
fieldset[disabled] .form-control:focus:disabled,
.form-control-wrapper .form-control:focus:disabled, .form-control-wrapper .form-control:focus:disabled,
.form-control:focus:disabled { .form-control:focus:disabled,
fieldset[disabled] .form-control.focus:disabled,
.form-control-wrapper .form-control.focus:disabled,
.form-control.focus:disabled {
border-style: dashed; border-style: dashed;
} }
select.form-control { select.form-control {
height: 23px; height: 23px;
} }
select[multiple].form-control, select[multiple].form-control,
select[multiple].form-control:focus { select[multiple].form-control:focus,
select[multiple].form-control.focus {
height: 85px; height: 85px;
} }
.form-control-wrapper { .form-control-wrapper {
position: relative; position: relative;
/* active state */ /* active state */
} }
.form-control-wrapper .form-control:focus { .form-control-wrapper .form-control:focus,
.form-control-wrapper .form-control.focus {
outline: none; outline: none;
} }
.form-control-wrapper .floating-label { .form-control-wrapper .floating-label {
@ -1221,14 +1243,18 @@ select[multiple].form-control:focus {
font-size: 10px; font-size: 10px;
opacity: 1; opacity: 1;
} }
.form-control-wrapper .form-control:focus:invalid ~ .floating-label { .form-control-wrapper .form-control:focus:invalid ~ .floating-label,
.form-control-wrapper .form-control.focus:invalid ~ .floating-label {
color: #f44336; color: #f44336;
} }
.form-control-wrapper .form-control:focus ~ .material-input:after { .form-control-wrapper .form-control:focus ~ .material-input:after,
.form-control-wrapper .form-control.focus ~ .material-input:after {
background-color: #5264ae; background-color: #5264ae;
} }
.form-control-wrapper .form-control:focus:invalid ~ .material-input:before, .form-control-wrapper .form-control:focus:invalid ~ .material-input:before,
.form-control-wrapper .form-control:focus:invalid ~ .material-input:after { .form-control-wrapper .form-control.focus:invalid ~ .material-input:before,
.form-control-wrapper .form-control:focus:invalid ~ .material-input:after,
.form-control-wrapper .form-control.focus:invalid ~ .material-input:after {
background-color: #f44336; background-color: #f44336;
} }
.form-control-wrapper .form-control.empty ~ .floating-label { .form-control-wrapper .form-control.empty ~ .floating-label {
@ -1245,7 +1271,8 @@ select[multiple].form-control:focus {
transform: scaleX(0); transform: scaleX(0);
transition: transform 0s; transition: transform 0s;
} }
.form-control-wrapper .form-control:focus ~ .material-input:before { .form-control-wrapper .form-control:focus ~ .material-input:before,
.form-control-wrapper .form-control.focus ~ .material-input:before {
transform: scaleX(1); transform: scaleX(1);
transition: transform 0.2s ease-out; transition: transform 0.2s ease-out;
} }
@ -1270,7 +1297,8 @@ select[multiple].form-control:focus {
.form-control-wrapper textarea ~ .form-control-highlight { .form-control-wrapper textarea ~ .form-control-highlight {
margin-top: -11px; margin-top: -11px;
} }
.form-control-wrapper .form-control:focus ~ .material-input:after { .form-control-wrapper .form-control:focus ~ .material-input:after,
.form-control-wrapper .form-control.focus ~ .material-input:after {
-webkit-animation: input-highlight 0.3s ease; -webkit-animation: input-highlight 0.3s ease;
animation: input-highlight 0.3s ease; animation: input-highlight 0.3s ease;
-webkit-animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards;
@ -1284,7 +1312,8 @@ select[multiple].form-control:focus {
display: none; display: none;
} }
.form-group.has-warning .material-input:before, .form-group.has-warning .material-input:before,
.form-group.has-warning input.form-control:focus ~ .material-input:after { .form-group.has-warning input.form-control:focus ~ .material-input:after,
.form-group.has-warning input.form-control.focus ~ .material-input:after {
background: #ff5722; background: #ff5722;
} }
.form-group.has-warning .control-label, .form-group.has-warning .control-label,
@ -1292,7 +1321,8 @@ select[multiple].form-control:focus {
color: #ff5722; color: #ff5722;
} }
.form-group.has-error .material-input:before, .form-group.has-error .material-input:before,
.form-group.has-error input.form-control:focus ~ .material-input:after { .form-group.has-error input.form-control:focus ~ .material-input:after,
.form-group.has-error input.form-control.focus ~ .material-input:after {
background: #f44336; background: #f44336;
} }
.form-group.has-error .control-label, .form-group.has-error .control-label,
@ -1300,7 +1330,8 @@ select[multiple].form-control:focus {
color: #f44336; color: #f44336;
} }
.form-group.has-success .material-input:before, .form-group.has-success .material-input:before,
.form-group.has-success input.form-control:focus ~ .material-input:after { .form-group.has-success input.form-control:focus ~ .material-input:after,
.form-group.has-success input.form-control.focus ~ .material-input:after {
background: #0f9d58; background: #0f9d58;
} }
.form-group.has-success .control-label, .form-group.has-success .control-label,
@ -1308,7 +1339,8 @@ select[multiple].form-control:focus {
color: #0f9d58; color: #0f9d58;
} }
.form-group.has-info .material-input:before, .form-group.has-info .material-input:before,
.form-group.has-info input.form-control:focus ~ .material-input:after { .form-group.has-info input.form-control:focus ~ .material-input:after,
.form-group.has-info input.form-control.focus ~ .material-input:after {
background: #03a9f4; background: #03a9f4;
} }
.form-group.has-info .control-label, .form-group.has-info .control-label,
@ -1455,6 +1487,76 @@ select[multiple].form-control:focus {
.form-group-material-lightgrey input.form-control:focus ~ .material-input:after { .form-group-material-lightgrey input.form-control:focus ~ .material-input:after {
background-color: #ececec; background-color: #ececec;
} }
.form-group input.form-control.focus ~ .material-input:after,
.form-group-default input.form-control.focus ~ .material-input:after {
background-color: #3f51b5;
}
.form-group-primary input.form-control.focus ~ .material-input:after {
background-color: #4285f4;
}
.form-group-success input.form-control.focus ~ .material-input:after {
background-color: #0f9d58;
}
.form-group-info input.form-control.focus ~ .material-input:after {
background-color: #03a9f4;
}
.form-group-warning input.form-control.focus ~ .material-input:after {
background-color: #ff5722;
}
.form-group-danger input.form-control.focus ~ .material-input:after {
background-color: #f44336;
}
.form-group-material-red input.form-control.focus ~ .material-input:after {
background-color: #f44336;
}
.form-group-material-pink input.form-control.focus ~ .material-input:after {
background-color: #e91e63;
}
.form-group-material-purple input.form-control.focus ~ .material-input:after {
background-color: #9c27b0;
}
.form-group-material-deeppurple input.form-control.focus ~ .material-input:after {
background-color: #673ab7;
}
.form-group-material-indigo input.form-control.focus ~ .material-input:after {
background-color: #3f51b5;
}
.form-group-material-lightblue input.form-control.focus ~ .material-input:after {
background-color: #03a9f4;
}
.form-group-material-cyan input.form-control.focus ~ .material-input:after {
background-color: #00bcd4;
}
.form-group-material-teal input.form-control.focus ~ .material-input:after {
background-color: #009688;
}
.form-group-material-lightgreen input.form-control.focus ~ .material-input:after {
background-color: #8bc34a;
}
.form-group-material-lime input.form-control.focus ~ .material-input:after {
background-color: #cddc39;
}
.form-group-material-lightyellow input.form-control.focus ~ .material-input:after {
background-color: #ffeb3b;
}
.form-group-material-orange input.form-control.focus ~ .material-input:after {
background-color: #ff9800;
}
.form-group-material-deeporange input.form-control.focus ~ .material-input:after {
background-color: #ff5722;
}
.form-group-material-grey input.form-control.focus ~ .material-input:after {
background-color: #9e9e9e;
}
.form-group-material-bluegrey input.form-control.focus ~ .material-input:after {
background-color: #607d8b;
}
.form-group-material-brown input.form-control.focus ~ .material-input:after {
background-color: #795548;
}
.form-group-material-lightgrey input.form-control.focus ~ .material-input:after {
background-color: #ececec;
}
.form-group .control-label, .form-group .control-label,
.form-group-default .control-label { .form-group-default .control-label {
color: rgba(0, 0, 0, 0.84); color: rgba(0, 0, 0, 0.84);
@ -1615,7 +1717,8 @@ select.form-control {
border-bottom: 1px solid #757575; border-bottom: 1px solid #757575;
border-radius: 0; border-radius: 0;
} }
select.form-control:focus { select.form-control:focus,
select.form-control.focus {
box-shadow: none; box-shadow: none;
border-color: #757575; border-color: #757575;
} }

View File

@ -1342,7 +1342,7 @@
<form class="bs-component"> <form class="bs-component">
<div class="form-group"> <div class="form-group">
<input class="form-control floating-label" id="focusedInput" type="text" placeholder="Floating label on click input"> <input class="form-control floating-label" id="focusedInput" type="text" placeholder="Write something to make the label float">
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@ -41,8 +41,8 @@
input[type=checkbox] ~ .check { input[type=checkbox] ~ .check {
position: absolute; position: absolute;
top: 0px; top: 2px;
left: 0px; left: 11px;
width: 18px; width: 18px;
height: 18px; height: 18px;
border: solid 2px; border: solid 2px;

View File

@ -1,8 +1,10 @@
// main: material.less // main: material.less
.form-control-wrapper .form-control, .form-control { fieldset[disabled] .form-control, .form-control-wrapper .form-control, .form-control {
&, &:focus { &, &:focus, &.focus {
height: 28px; &:not(textarea):not(select) {
height: 28px;
}
padding: 0; padding: 0;
float: none; float: none;
border: 0; border: 0;
@ -19,7 +21,7 @@ select.form-control {
height: 23px; height: 23px;
} }
select[multiple].form-control { select[multiple].form-control {
&, &:focus { &, &:focus, &.focus {
height: 85px; height: 85px;
} }
} }
@ -27,7 +29,7 @@ select[multiple].form-control {
.form-control-wrapper { .form-control-wrapper {
position: relative; position: relative;
.form-control:focus { .form-control:focus, .form-control.focus {
outline: none; outline: none;
} }
@ -46,13 +48,13 @@ select[multiple].form-control {
font-size: 10px; font-size: 10px;
opacity: 1; opacity: 1;
} }
.form-control:focus:invalid ~ .floating-label { .form-control:focus:invalid ~ .floating-label, .form-control.focus:invalid ~ .floating-label {
color: @input-danger; color: @input-danger;
} }
.form-control:focus ~ .material-input:after { .form-control:focus ~ .material-input:after, .form-control.focus ~ .material-input:after {
background-color: @input-default; background-color: @input-default;
} }
.form-control:focus:invalid ~ .material-input { .form-control:focus:invalid ~ .material-input, .form-control.focus:invalid ~ .material-input {
&:before, &:after { &:before, &:after {
background-color: @input-danger; background-color: @input-danger;
} }
@ -71,7 +73,7 @@ select[multiple].form-control {
transform: scaleX(0); transform: scaleX(0);
transition: transform 0s; transition: transform 0s;
} }
.form-control:focus ~ .material-input:before { .form-control:focus ~ .material-input:before, .form-control.focus ~ .material-input:before {
transform: scaleX(1); transform: scaleX(1);
transition: transform 0.2s ease-out; transition: transform 0.2s ease-out;
} }
@ -96,7 +98,7 @@ select[multiple].form-control {
} }
/* active state */ /* active state */
.form-control:focus ~ .material-input:after { .form-control:focus ~ .material-input:after, .form-control.focus ~ .material-input:after {
-webkit-animation: input-highlight 0.3s ease; -webkit-animation: input-highlight 0.3s ease;
animation: input-highlight 0.3s ease; animation: input-highlight 0.3s ease;
-webkit-animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards;
@ -115,7 +117,7 @@ select[multiple].form-control {
.form-group { .form-group {
&.has-warning { &.has-warning {
.material-input:before, input.form-control:focus ~ .material-input:after { .material-input:before, input.form-control:focus ~ .material-input:after, input.form-control.focus ~ .material-input:after {
background: @input-warning; background: @input-warning;
} }
.control-label, input.form-control:not(.empty) ~ .floating-label { .control-label, input.form-control:not(.empty) ~ .floating-label {
@ -123,7 +125,7 @@ select[multiple].form-control {
} }
} }
&.has-error { &.has-error {
.material-input:before, input.form-control:focus ~ .material-input:after { .material-input:before, input.form-control:focus ~ .material-input:after, input.form-control.focus ~ .material-input:after {
background: @input-danger; background: @input-danger;
} }
.control-label, input.form-control:not(.empty) ~ .floating-label { .control-label, input.form-control:not(.empty) ~ .floating-label {
@ -131,7 +133,7 @@ select[multiple].form-control {
} }
} }
&.has-success { &.has-success {
.material-input:before, input.form-control:focus ~ .material-input:after { .material-input:before, input.form-control:focus ~ .material-input:after, input.form-control.focus ~ .material-input:after {
background: @input-success; background: @input-success;
} }
.control-label, input.form-control:not(.empty) ~ .floating-label { .control-label, input.form-control:not(.empty) ~ .floating-label {
@ -139,7 +141,7 @@ select[multiple].form-control {
} }
} }
&.has-info { &.has-info {
.material-input:before, input.form-control:focus ~ .material-input:after { .material-input:before, input.form-control:focus ~ .material-input:after, input.form-control.focus ~ .material-input:after {
background: @input-info; background: @input-info;
} }
.control-label, input.form-control:not(.empty) ~ .floating-label { .control-label, input.form-control:not(.empty) ~ .floating-label {
@ -148,6 +150,7 @@ select[multiple].form-control {
} }
.variations(~" .material-input:before", background-color, @indigo); .variations(~" .material-input:before", background-color, @indigo);
.variations(~" input.form-control:focus ~ .material-input:after", background-color, @indigo); .variations(~" input.form-control:focus ~ .material-input:after", background-color, @indigo);
.variations(~" input.form-control.focus ~ .material-input:after", background-color, @indigo);
.variations(~" .control-label", color, @lightbg-text); .variations(~" .control-label", color, @lightbg-text);
.variations(~" input.form-control:not(.empty) ~ .floating-label", color, @indigo); .variations(~" input.form-control:not(.empty) ~ .floating-label", color, @indigo);
@ -175,7 +178,7 @@ select.form-control {
box-shadow: none; box-shadow: none;
border-bottom: 1px solid #757575; border-bottom: 1px solid #757575;
border-radius: 0; border-radius: 0;
&:focus { &:focus, &.focus {
box-shadow: none; box-shadow: none;
border-color: #757575; border-color: #757575;
} }

View File

@ -2,7 +2,7 @@
// Material Theme 0.0.1 // Material Theme 0.0.1
// ----------------------------------------------------- // -----------------------------------------------------
@import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,700,300|Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic); @import url(//fonts.googleapis.com/css?family=Roboto+Condensed:300italic,400italic,700italic,400,700,300|Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic);
@import "variables.less"; @import "variables.less";
@import "mixins.less"; @import "mixins.less";

10
less/test.css Normal file
View File

@ -0,0 +1,10 @@
/* Generated by less 1.7.0 */
.btn-default {
color: #000000;
}
.btn-primary {
color: #4285f4;
}
.btn-success {
color: #0f9d58;
}

39
less/test.less Normal file
View File

@ -0,0 +1,39 @@
@import "variables.less";
.color(@default) {
&-default {
color: @default;
}
&-primary {
color: @primary;
}
&-success {
color: @success;
}
// etc
}
.btn {
.color(black);
}
.background(@default) {
&-default {
color: @default;
}
&-primary {
color: @primary;
}
&-success {
color: @success;
}
}
.variations(@extra, @property) {
&-default@{extra} { &:extend(.@{property}-default); }
&-primary@{extra} { &:extend(.@{property}-primary); }
// etc
}
.label {
.variations(~"", btn);
}

View File

@ -5,10 +5,10 @@ $(function (){
ripples.init(".btn:not(.btn-link), .navbar a, .nav-tabs a, .withripple"); ripples.init(".btn:not(.btn-link), .navbar a, .nav-tabs a, .withripple");
// Add fake-checkbox to material checkboxes // Add fake-checkbox to material checkboxes
$(".checkbox label input").after("<span class=ripple></span><span class=check></span>"); $(".checkbox > label > input").after("<span class=ripple></span><span class=check></span>");
// Add fake-radio to material radios // Add fake-radio to material radios
$(".radio label input").after("<span class=ripple></span><span class=circle></span><span class=check></span>"); $(".radio > label > input").after("<span class=ripple></span><span class=circle></span><span class=check></span>");
// Add elements for material inputs // Add elements for material inputs
$("input.form-control, textarea.form-control, select.form-control").each( function() { $("input.form-control, textarea.form-control, select.form-control").each( function() {
@ -24,12 +24,15 @@ $(function (){
} }
}); });
$(document).on("keyup", ".form-control", function() { $(document).on("keyup change", ".form-control", function() {
if ($(this).val() !== "") { if ($(this).val() !== "") {
$(this).removeClass("empty"); $(this).removeClass("empty");
} else { } else {
$(this).addClass("empty"); $(this).addClass("empty");
} }
}); });
$(document).on("keydown", ".form-control", function() {
$(this).removeClass("empty");
});
}); });