Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
@mixin radio-variant($box, $check, $label) {
2
    label {
3
      color: $label;
4
    }
5
 
6
    label > .box {
7
      border-color: $box;
8
    }
9
 
10
    label > .check {
11
      background: $check;
12
    }
13
}
14
 
15
@mixin radio-label-variant($color) {
16
    label {
17
      color: $color;
18
    }
19
}
20
 
21
 
22
.md-radio {
23
    position:relative;
24
 
25
    input[type=radio]   {
26
        visibility: hidden;
27
        position: absolute;
28
    }
29
 
30
    label {
31
        cursor:pointer;
32
        padding-left: 30px;
33
    }
34
 
35
    label > span {
36
        display:block;
37
        position:absolute;
38
        left:0;
39
        -webkit-transition-duration:0.3s;
40
        -moz-transition-duration:0.3s;
41
        transition-duration:0.3s;
42
    }
43
 
44
    label > span.inc   {
45
      background: #fff;
46
      left:-20px;
47
      top:-20px;
48
      height:60px;
49
      width:60px;
50
      opacity:0;
51
      border-radius:50% !important;
52
      -moz-border-radius:50% !important;
53
      -webkit-border-radius:50% !important;
54
    }
55
 
56
    label > .box {
57
      top: 0px;
58
      border:2px solid $input-md-checkbox-box-color;
59
      height:20px;
60
      width:20px;
61
       border-radius:50% !important;
62
      -moz-border-radius:50% !important;
63
      -webkit-border-radius:50% !important;
64
      z-index:5;
65
    }
66
 
67
    label > .check {
68
      top: 5px;
69
      left: 5px;
70
      width: 10px;
71
      height: 10px;
72
      background: $input-md-focus-border;
73
      opacity:0;
74
      z-index:6;
75
 
76
      border-radius:50% !important;
77
      -moz-border-radius:50% !important;
78
      -webkit-border-radius:50% !important;
79
 
80
      -webkit-transform   :scale(0);
81
      -moz-transform      :scale(0);
82
      transform           :scale(0);
83
    }
84
 
85
    /* handling click events */
86
 
87
    /* when radio is checked */
88
    label > span.inc {
89
      -webkit-animation   :growCircleRadio 0.3s ease;
90
      -moz-animation      :growCircleRadio 0.3s ease;
91
      animation           :growCircleRadio 0.3s ease;
92
    }
93
 
94
    input[type=radio]:checked ~ label > .check {
95
      opacity:1;
96
      -webkit-transform   :scale(1);
97
      -moz-transform      :scale(1);
98
      transform           :scale(1);
99
    }
100
 
101
    // Disabled state
102
    input[type=radio]:disabled ~ label,
103
    input[type=radio][disabled] ~ label {
104
        cursor: not-allowed;
105
        @include opacity($input-md-checkbox-disabled-opacity);
106
    }
107
 
108
    input[type=radio]:disabled ~ label > .box,
109
    input[type=radio][disabled] ~ label > .box {
110
        cursor: not-allowed;
111
        @include opacity($input-md-checkbox-disabled-opacity);
112
    }
113
 
114
    input[type=radio]:disabled:checked ~ label > .check,
115
    input[type=radio][disabled]:checked ~ label > .check {
116
        cursor: not-allowed;
117
        @include opacity($input-md-checkbox-disabled-opacity);
118
    }
119
}
120
 
121
// Error states
122
//radio-variant($box, $check, $label)
123
 
124
.has-error .md-radio,
125
.has-error.md-radio {
126
    @include radio-variant($state-danger-text, $state-danger-text, $state-danger-text);
127
}
128
 
129
.has-success .md-radio,
130
.has-success.md-radio {
131
    @include radio-variant($state-success-text, $state-success-text, $state-success-text);
132
}
133
 
134
.has-warning .md-radio,
135
.has-warning.md-radio {
136
    @include radio-variant($state-warning-text, $state-warning-text, $state-warning-text);
137
}
138
 
139
.has-info .md-radio,
140
.has-info.md-radio {
141
    @include radio-variant($state-info-text, $state-info-text, $state-info-text);
142
}
143
 
144
 
145
.form-md-radios {
146
  padding-top: 5px;
147
 
148
    > label {
149
        font-size: $input-md-label-font-size;
150
        color: $input-md-label-color;
151
        @include opacity($input-md-label-opacity);
152
    }
153
 
154
    &.has-error {
155
        @if $theme-type == "material-design" {
156
            @include radio-label-variant($state-danger-bg);
157
        } @else {
158
            @include radio-label-variant($brand-danger);
159
        }
160
    }
161
 
162
    &.has-info {
163
        @if $theme-type == "material-design" {
164
            @include radio-label-variant($state-info-bg);
165
        } @else {
166
            @include radio-label-variant($brand-info);
167
        }
168
    }
169
 
170
    &.has-success {
171
        @if $theme-type == "material-design" {
172
            @include radio-label-variant($state-success-bg);
173
        } @else {
174
            @include radio-label-variant($brand-success);
175
        }
176
    }
177
 
178
    &.has-warning {
179
        @if $theme-type == "material-design" {
180
            @include radio-label-variant($state-warning-bg);
181
        } @else {
182
            @include radio-label-variant($brand-warning);
183
        }
184
    }
185
}
186
 
187
.md-radio-list {
188
  margin: 5px 0 5px 0;
189
 
190
  .form-horizontal & {
191
    margin-top: 5px;
192
  }
193
 
194
  .md-radio {
195
    display: block;
196
    margin-bottom: 10px;
197
  }
198
}
199
 
200
.md-radio-inline {
201
  margin: 5px 0 5px 0;
202
 
203
  .form-horizontal & {
204
    margin-top: 7px;
205
  }
206
 
207
  .md-radio {
208
    display: inline-block;
209
    margin-right: 20px;
210
 
211
    &:last-child {
212
      margin-right: 0;
213
    }
214
  }
215
}
216
 
217
/* bubble animation */
218
 
219
@-webkit-keyframes growCircleRadio {
220
  0%, 100%   { -webkit-transform:scale(0); opacity: 1}
221
  70%        { background:#eee; -webkit-transform:scale(1.25); }
222
}
223
@-moz-keyframes growCircleRadio {
224
  0%, 100%   { -moz-transform:scale(0); opacity: 1}
225
  70%        { background:#eee; -moz-transform:scale(1.25); }
226
}
227
@keyframes growCircleRadio {
228
  0%, 100%   { transform:scale(0); opacity: 1}
229
  70%        { background:#eee; transform:scale(1.25); }
230
}