123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610 |
- //some checkbox & switch variables
- @checkbox-color: #32A3CE;
- @checkbox-border-color: #C8C8C8;
- @checkbox-checked-border: #ADB8C0;
- @checkbox-hover-border: #FF893C;
- @checkbox2-bg: #F9A021;
- @switch-checked-bg: #8AB2C9;
- @switch-checked-border: #6A8CA8;
- @switch4-bg: #8B9AA3;
- @switch4-color: #939393;
- @switch4-checked-bg: #468FCC;
- @switch6-checked-border: #B7D3E5;
- @switch6-checked-bg: #FF893C;
- @switch7-checked-bg: #468FCC;
- @switch7-checked-border: #6FB3E0;
- @switch-1-text: "ON\a0\a0\a0\a0\a0\a0\a0\a0\a0OFF";
- @switch-2-text: "YES\a0\a0\a0\a0\a0\a0\a0\a0\a0NO";
- @switch-4-text: "ON\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0OFF";
- @switch-5-text: "YES\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0NO";
- @switch-7-text: "OFF\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0ON";
- @lbl_selector: ~"+ .lbl";
- //@lbl_selector: ~"~ .lbl";//uncomment for ASP.NET or use css builder tool
- .enable_checkbox() when(@enable-checkbox = true) {
- //Checkbox & Radio
- @lbl: @lbl_selector;//+ .lbl or ~ .lbl (for ASP.NET)
- input[type=checkbox].ace , input[type=radio].ace {
- opacity: 0;
- position: absolute;
- z-index: 1;//so that it is clickable and above (.lbl)
-
- width: 18px;
- height: 18px;
- cursor: pointer;
- label & {
- z-index: -100 !important;
- width: 1px !important;//width '0' has issues with jQuery Validate not recognizing this
- height: 1px !important;
- clip: rect(1px, 1px, 1px, 1px);
- position: absolute;//"fixed" causes issues on iOS safari?!
- //we don't need it to be hoverable/clickable when inside a label
- }
-
- &:checked, &:focus {
- outline: none !important;
- }
-
- @{lbl} {
- position: relative;
- display:inline-block;
- margin:0;
- line-height:20px;
- min-height:18px;
- min-width:18px;
- font-weight:normal;
-
- cursor: pointer;
- &::before {
- cursor: pointer;
-
- font-family: fontAwesome;
- font-weight: normal;
- font-size: @font-size-checkbox;
- color: @checkbox-color;
- content: "\a0";
- display: inline-block;
- background-color: #FAFAFA;
- border: 1px solid @checkbox-border-color;
- box-shadow: 0 1px 2px rgba(0,0,0,0.05);/*, inset 0px -15px 10px -12px rgba(0,0,0,0.05);*/
- border-radius: 0;
- display: inline-block;
- text-align: center;
-
- //vertical-align: text-bottom;
- //vertical-align: middle;
- height: 16px;
- line-height: 14px;
- min-width: 16px;
-
- margin-right: 1px;
-
- position: relative;
- top: -1px;
- }
- }//.lbl
-
- &:checked @{lbl}::before ,
- {
- display:inline-block;
- content: '\f00c';
- background-color: #F5F8FC;
- border-color:@checkbox-checked-border;
- box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1);
- }
- &:hover @{lbl}::before , @{lbl}:hover::before {
- border-color:@checkbox-hover-border;
- }
-
- &:active , &:checked:active {
- @{lbl}::before {
- box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px 1px 3px rgba(0,0,0,0.1);
- }
- }
-
-
- &.ace-checkbox-2 @{lbl}::before {
- box-shadow: none;
- }
- &.ace-checkbox-2:checked @{lbl}::before {
- background-color: @checkbox2-bg;
- border-color: @checkbox2-bg;
- color: #FFF;
- }
- &:disabled @{lbl}::before ,
- &[disabled] @{lbl}::before ,
- &.disabled @{lbl}::before {
- background-color:#DDD !important;
- border-color:#CCC !important;
- box-shadow:none !important;
- color:#BBB;
- }
- }
- //opera fix
- //no_such_element:-o-prefocus, input[type=checkbox].ace @{lbl}::before, input[type=radio].ace @{lbl}::before {
- //vertical-align: middle;
- //}
- .checkbox label input[type=checkbox].ace @{lbl}, .radio label input[type=radio].ace @{lbl} {
- margin-left: -10px;
- }
- /**
- input[type=radio].ace @{lbl}::before {
- border-radius:100%;
- font-size: 34px;
- font-family: Helvetica, Arial, "Sans-Serif";//looks better but incosistent
- line-height: 13px;
- }
- */
- input[type=radio].ace @{lbl}::before {
- border-radius: 100%;
- font-size: @font-size-radio;
- font-family: FontAwesome;//let's use a fonts that's available everywhere
- text-shadow: 0 0 1px @checkbox-color;
- line-height: 15px;
- height: 17px;
- min-width: 17px;
- }
- input[type=radio].ace:checked @{lbl}::before {
- content:"\f111";
- }
- input[type=checkbox].ace.input-lg @{lbl}::before{
- border-radius: 4px;
- font-size: @font-size-checkbox-large;
-
- height: 24px;
- line-height: 21px;
- min-width: 24px;
- top: auto;
- }
- input[type=radio].ace.input-lg @{lbl}::before {
- font-size: @font-size-radio-large;
-
- height: 24px;
- line-height: 22px;
- min-width: 24px;
- top: auto;
- }
- /* CSS3 on/off switches */
- //use like <input type="checkbox" class="ace ace-switch" /> <span class="lbl"></span>
- .enable_switches() when(@enable-switch = true) {
- input[type=checkbox].ace.ace-switch {
- width: 55px;
- height: 25px;
- @{lbl} {
- margin:0 4px;
- min-height:24px;
-
- &::before {
- font-family: 'Open Sans';
- content: @switch-1-text;
- color: #999;
- text-shadow: 0 0 0 #999;
- font-weight: normal;
- font-size: @font-size-switch-1-text;
- line-height: 17px;// line-height:21px \9;/*ie9*/
- height: 20px;
- overflow: hidden;
- border-radius: 12px;
- background-color: #F5F5F5;
- //.box-shadow(~"inset 0px 2px 2px 0px rgba(0,0,0,.2)");
- .box-shadow(~"inset 0 1px 1px 0 rgba(0, 0, 0, 0.15)");
-
- border: 1px solid #CCC;
- text-align: left;
- float: left;
- padding: 0;
- width: 52px;
- text-indent: -21px;// text-indent: -21px \9;
- margin-right: 0;
- .transition(~"text-indent .3s ease");
-
- top: auto;
- }
-
- &::after {
- font-family: 'Open Sans';
- content: 'III';
- font-size: @font-size-switch-1-bar;
- font-weight: normal;
- letter-spacing: 0;
- color: #AAA;
-
- text-shadow: none;
- //text-shadow: 0 0 0 #999;
-
-
- background-color: #FFF;
-
- //text-align: center;
- //text-indent: -2px;
-
- border-radius: 100%;
-
- width: 22px;
- height: 22px;
- line-height: 22px;
- text-align: center;
-
-
- position: absolute;
- top: -2px;
- left: -3px;
-
- .box-shadow(~"0px 1px 1px 1px rgba(0,0,0,.3)");
- //text-shadow:0px 1px 1px rgba(0,0,0,0.3) inset;
- .transition(~"left .3s ease");
- }
- }
-
- &:checked @{lbl} {
- &::before {
- text-indent: 8px;
- color: #FFF;
- text-shadow: 0 0 0 #FFF;
- background-color: @switch-checked-bg;
- border-color: @switch-checked-border;
- }
- &::after {
- left: 34px;
- background-color: #FFF;
- color: #98A0A5;
- //text-shadow: 0 0 0 #465868;
- }
- }
-
-
- &.ace-switch-2 @{lbl}::before {
- content: @switch-2-text;
- }
- &.ace-switch-3 @{lbl}::after {
- font-family: FontAwesome;
- font-size: @font-size-switch-3-text;
- line-height: 22px;
- content: "\f00d";
- top: -1px;
- text-shadow: none;
- padding: 0;
- text-align: center;
- color: #BBB;
- letter-spacing: 0;
- }
- &.ace-switch-3:checked @{lbl}::after {
- content: "\f00c";
- color: #8AB2C9;
- text-shadow: none;
- }
-
- //switch style 4 & 5
- .enable_switch_style_4() when(@enable-switch-style-4 = true) {
- &.ace-switch-4 , &.ace-switch-5 {
- width: 60px;
- @{lbl}::before {
- content: @switch-4-text;
- //font-family:Arial, Helvetica, sans-serif;
- //font-weight:bolder;
- font-size: @font-size-switch-4-text;
- line-height: 21px;
- height: 24px;
- overflow: hidden;
- //line-height:25px \9;
-
- border-radius: 12px;
-
- display: inline-block;
- background-color: @switch4-bg;
- border: 1px solid @switch4-bg;
- color: #FFF;
- width: 56px;
- text-indent: -25px;// text-indent: -28px \9;
- text-shadow: 0 0 0 #FFF;
-
- display: inline-block;
- position: relative;
-
- //margin-right:8px;
-
- box-shadow:none;
-
- .transition(~"all .3s ease");
- }
-
- @{lbl}::after {
- content: 'III';
-
- font-size: @font-size-switch-4-bar;
- position: absolute;
- top: 2px;
- left: 2px;
-
- letter-spacing: 0;
-
- width: 20px;
- height: 20px;
- line-height: 19px;
-
- text-shadow: none !important;
- color: @switch4-color;
- background-color:#FFF;
- .transition(~"all .3s ease");
- }
-
- &:checked @{lbl} {
- &::before {
- text-indent: 9px;
- background-color: @switch4-checked-bg;
- border-color: #468FCC;
- }
- &::after {
- left: 34px;
- background-color: #FFF;
- color: darken(@switch4-color , 6%);
- }
- }
-
-
- }
- &.ace-switch-5 @{lbl}::before {
- content: @switch-5-text;
- }
- &.ace-switch-5:checked @{lbl}::before {
- text-indent: 8px;
- }
- }
- .enable_switch_style_4();
-
-
- .enable_switch_style_6() when(@enable-switch-style-6 = true) {
- //switch style 6
- &.ace-switch-6 {
- @{lbl} {
- position: relative;
- &::before {
- font-family: FontAwesome;
- content: "\f00d";
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- box-shadow: none;
- border-width: 0;
- font-weight: lighter;
- font-size: @font-size-switch-6-text;
- border-radius: 12px;
- display: inline-block;
- background-color: #888;
- color: #F2F2F2;
- width: 52px;
- height: 22px;
- line-height: 21px;
- text-indent: 32px;
- .transition(~"background 0.1s ease");
- }
- &::after {
- content: ''; text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
- position: absolute;
- top: 2px;
- left: 3px;
-
- border-radius: 12px;
- box-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
- width: 18px;
- height: 18px;
- text-align: center;
-
- background-color: #F2F2F2;
- border: 4px solid #F2F2F2;
-
- .transition(~"left 0.2s ease");
- }
- }
-
- &:checked @{lbl} {
- &::before {
- content: "\f00c";
- text-indent:6px;
- color:#FFF;
- border-color:@switch6-checked-border;
- background-color:@switch6-checked-bg;
- }
- &::after {
- left:32px;
- background-color:#FFF;
- border:4px solid #FFF;
- text-shadow:0 -1px 0 rgba(0, 200, 0, 0.25);
- }
- }
- }
- }
- .enable_switch_style_6();
-
-
- .enable_switch_style_7() when(@enable-switch-style-7 = true) {
- &.ace-switch-7 {
- width:75px;
- @{lbl} {
- position: relative;
- &::before {
- content: @switch-7-text;
- font-weight: bolder;
- font-size: @font-size-switch-7-text;
- line-height: 20px;
- display: inline-block;
- background-color: #FFF;
- border: 2px solid #AAA;
- border-radius: 0;
- box-shadow: none;
- color: #AAA;
- width: 74px;
- height: 26px;
- line-height: 22px;
- overflow: hidden;
- text-indent: 5px;
-
- display: inline-block;
- position: relative;
-
- //margin-right:8px;
- .transition(~"all 0.2s ease");
- }
-
- &::after {
- content: '\f00d';
- font-family: FontAwesome;
- font-size: @font-size-switch-7-bar;
- position: absolute;
- top: 3px;
- left: 39px;
- width: 32px;
- height: 20px;
- line-height: 18px;
-
- text-align: center;
- padding: 0;
- text-indent: 0;
-
- background-color: #AAA;
- color: #FFF;
- border-radius: 0;
- box-shadow: none;
- .transition(~"all 0.2s ease-in-out");
- }
- }
-
- &:checked @{lbl} {
- &::before {
- color: @switch7-checked-bg;
- background-color: #FFF;
- text-indent: -28px;
- border-color: @switch7-checked-border;
- }
- &::after {
- left: 3px;
- content: '\f00c';
- background-color: @switch7-checked-bg;
- color: #FFF;
- }
- }
- }
- }
- .enable_switch_style_7();
- }
- //any custom text
- input[type=checkbox].ace.ace-switch @{lbl}[data-lbl]::before {
- content: attr(data-lbl);
- }
- input[type=checkbox].ace.ace-switch.btn-empty @{lbl}::after {
- content: "";
- }
- input[type=checkbox].ace.ace-switch.btn-rotate @{lbl}::after {
- content: "\2261";// the 3 line (menu) character
- line-height: 20px;
- font-size: @font-size-switch-rotated-bar;
- }
- input[type=checkbox].ace.ace-switch-4.btn-rotate @{lbl}::after,
- input[type=checkbox].ace.ace-switch-5.btn-rotate @{lbl}::after {
- line-height: 17px;
- }
-
-
- //flat, square
- input[type=checkbox].ace.ace-switch.btn-flat @{lbl}::before,
- input[type=checkbox].ace.ace-switch.btn-flat @{lbl}::after {
- border-radius: 0 !important;
- }
- input[type=checkbox].ace.ace-switch.ace-switch-4 , input[type=checkbox].ace.ace-switch.ace-switch-5 {
- @{lbl}::before {
- text-indent: -24px;
- }
- &:checked @{lbl}::before {
- text-indent: 7px;
- }
- }
- }
- .enable_switches();
-
- input.ace @{lbl} {
- .checkbox-paddings() {// a little paddings for .lbl
- .checkbox-paddingX (@index) when (@index >= 0) {
- &.padding-@{index}::before {
- margin-right: unit(@index,px);
- }
- .checkbox-paddingX(@index - 2);
- }
- .checkbox-paddingX(16);
- }
- .checkbox-paddings();
- }
- }
- .enable_checkbox();
|