mui-sass 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28053454a00e1c7a3a64d6fb3a8730d0da3535a9
4
- data.tar.gz: a9109a451382a7177256715fa0ff1b016984c2a2
3
+ metadata.gz: b6acc3165ff8c408c699f44001f77a3e6347c5e0
4
+ data.tar.gz: 1845264b55d6120e6a44cb9d7a10e3d438b05603
5
5
  SHA512:
6
- metadata.gz: b969a6308bb1573e21881f206a59090a214441dc63ede12679e6ff39eea7ca02e6f5d0d68f03e6aa3531dc8fbc9dd83f12cd5603583ae1a3f986d753f96b54c7
7
- data.tar.gz: f6f950034f6c81ab533564ae20ff58540b64eceec0fe079846f37b885bd3e85eb59304c5b0cf84ff85612d9d756c472339936cef008107beb3edbd02cafead30
6
+ metadata.gz: 55b35d3b93405b36d376117b064ea399ee870ce9b947002daa861c10fb5e7fc7a06c8a8c76519834e450b1c019ee6723f5958451ca27c3f549e06041fcb23cba
7
+ data.tar.gz: 1592dd27f1dbcad6ba07e21623679a0e5d94991828fc71f46d2e05b6befbd9d43542a312f6475a55865b5a077c67b0a709604ed5f4b26d2f381fd013e8ce6ca0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.2.1 (2015-10-17)
2
+
3
+ - Update assets to match upstream version
4
+
5
+ Framework version: MUI v0.2.1
6
+
1
7
  ## 0.2.0 (2015-10-13)
2
8
 
3
9
  - Update assets to match upstream version
@@ -1,5 +1,5 @@
1
1
  module Mui
2
2
  module Sass
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -498,12 +498,11 @@ module.exports = {
498
498
 
499
499
  var jqLite = require('../lib/jqLite.js'),
500
500
  util = require('../lib/util.js'),
501
- cssSelector = '.mui-textfield__input',
501
+ cssSelector = '.mui-textfield > input, .mui-textfield > textarea',
502
502
  emptyClass = 'mui--is-empty',
503
503
  notEmptyClass = 'mui--is-not-empty',
504
504
  dirtyClass = 'mui--is-dirty',
505
- formControlClass = 'mui-textfield__input',
506
- floatingLabelClass = 'mui-textfield__label--floating';
505
+ floatingLabelClass = 'mui-textfield--float-label';
507
506
 
508
507
 
509
508
  /**
@@ -563,7 +562,7 @@ module.exports = {
563
562
 
564
563
  // add transition css for floating labels
565
564
  setTimeout(function() {
566
- var css = '.' + floatingLabelClass + '{' + [
565
+ var css = '.mui-textfield.mui-textfield--float-label > label {' + [
567
566
  '-webkit-transition',
568
567
  '-moz-transition',
569
568
  '-o-transition',
@@ -580,9 +579,9 @@ module.exports = {
580
579
  var targetEl = ev.target;
581
580
 
582
581
  if (targetEl.tagName === 'LABEL' &&
583
- jqLite.hasClass(targetEl, floatingLabelClass)) {
582
+ jqLite.hasClass(targetEl.parentNode, floatingLabelClass)) {
584
583
  var inputEl = targetEl.previousElementSibling;
585
- if (jqLite.hasClass(inputEl, formControlClass)) inputEl.focus();
584
+ if (inputEl) inputEl.focus();
586
585
  }
587
586
  });
588
587
  }
@@ -71,7 +71,23 @@ input[type="checkbox"]:disabled {
71
71
  white-space: nowrap;
72
72
  }
73
73
 
74
- > .mui-textfield__label--floating {
74
+ > textarea {
75
+ padding-top: 5px;
76
+ min-height: $mui-textarea-height;
77
+ }
78
+
79
+ > input,
80
+ > textarea {
81
+ display: block;
82
+
83
+ &:focus ~ label {
84
+ color: $mui-input-border-color-focus;
85
+ }
86
+ }
87
+ }
88
+
89
+ .mui-textfield--float-label {
90
+ > label {
75
91
  // Layout
76
92
  position: absolute;
77
93
  top: $xFormLabelLineHeight;
@@ -83,31 +99,43 @@ input[type="checkbox"]:disabled {
83
99
 
84
100
  // Overflow policy
85
101
  text-overflow: clip;
86
-
102
+
87
103
  // Cursor
88
104
  cursor: text; // for ie10
89
105
  pointer-events: none;
90
106
  }
91
107
 
108
+ > input,
92
109
  > textarea {
93
- padding-top: 5px;
94
- min-height: $mui-textarea-height;
95
- }
96
-
97
- > .mui-textfield__input {
98
- display: block;
99
- }
110
+ &:focus ~ label {
111
+ top: 0px;
112
+ font-size: $mui-label-font-size;
113
+ line-height: $xFormLabelLineHeight;
114
+ text-overflow: ellipsis;
115
+ }
100
116
 
101
- > .mui-textfield__input:focus ~ label {
102
- color: $mui-input-border-color-focus;
117
+ &:not(:focus) {
118
+ &.mui--is-not-empty,
119
+ &[value]:not([value=""]):not(.mui--is-empty):not(.mui--is-not-empty),
120
+ &:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty) {
121
+ ~ label {
122
+ color: $mui-label-font-color;
123
+ font-size: $mui-label-font-size;
124
+ line-height: $xFormLabelLineHeight;
125
+ top: 0px;
126
+ text-overflow: ellipsis;
127
+ }
128
+ }
129
+ }
103
130
  }
104
131
  }
105
132
 
106
133
  .mui-textfield--wrap-label {
107
134
  display: table;
135
+ width: 100%;
108
136
  padding-top: 0px;
109
137
 
110
- > label:not(.mui-textfield__label--floating) {
138
+ &:not(.mui-textfield--float-label) > label {
111
139
  display: table-header-group;
112
140
  position: static;
113
141
  white-space: normal;
@@ -115,30 +143,8 @@ input[type="checkbox"]:disabled {
115
143
  }
116
144
  }
117
145
 
118
- // Placed outside of form-group for performance
119
- .mui-textfield__input:focus ~ .mui-textfield__label--floating {
120
- top: 0px;
121
- font-size: $mui-label-font-size;
122
- line-height: $xFormLabelLineHeight;
123
- text-overflow: ellipsis;
124
- }
125
-
126
- // Placed outside of form-group for performance
127
- .mui-textfield__input:not(:focus) {
128
- &.mui--is-not-empty,
129
- &[value]:not([value=""]):not(.mui--is-empty):not(.mui--is-not-empty),
130
- &:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty) {
131
- ~ .mui-textfield__label--floating {
132
- color: $mui-label-font-color;
133
- font-size: $mui-label-font-size;
134
- line-height: $xFormLabelLineHeight;
135
- top: 0px;
136
- text-overflow: ellipsis;
137
- }
138
- }
139
- }
140
-
141
- .mui-textfield__input {
146
+ .mui-textfield > input,
147
+ .mui-textfield > textarea {
142
148
  @include mui-node-inserted();
143
149
 
144
150
  display: block;
@@ -175,11 +181,11 @@ input[type="checkbox"]:disabled {
175
181
  }
176
182
  }
177
183
 
178
- textarea.mui-textfield__input {
184
+ .mui-textfield > textarea {
179
185
  height: auto; // Reset height for <textarea>s
180
186
  }
181
187
 
182
- input.mui-textfield__input:focus {
188
+ .mui-textfield > input:focus {
183
189
  // Compensate for height change on focus
184
190
  height: $mui-input-height + 1px;
185
191
  margin-bottom: -1px;
@@ -366,11 +372,6 @@ input.mui-textfield__input:focus {
366
372
  margin-bottom: 0;
367
373
  }
368
374
 
369
- > .mui-textfield__input {
370
- display: inline-block;
371
- width: auto;
372
- }
373
-
374
375
  > .mui-radio,
375
376
  > .mui-checkbox {
376
377
  display: inline-block;
@@ -407,7 +408,8 @@ input.mui-textfield__input:focus {
407
408
  // FORM-VALIDATION
408
409
  // ============================================================================
409
410
 
410
- .mui-textfield__input {
411
+ .mui-textfield > input,
412
+ .mui-textfield > textarea {
411
413
  // Use thick colored border for invalid fields
412
414
  &:invalid:not(:focus) {
413
415
  &:not(:required),
@@ -422,7 +424,7 @@ input.mui-textfield__input:focus {
422
424
  }
423
425
 
424
426
  // Treat <input>'s different from <textarea>'s
425
- input.mui-textfield__input:invalid:not(:focus) {
427
+ .mui-textfield > input:invalid:not(:focus) {
426
428
  &:not(:required),
427
429
  &:required.mui--is-not-empty,
428
430
  &:required.mui--is-empty.mui--is-dirty,
@@ -433,7 +435,8 @@ input.mui-textfield__input:invalid:not(:focus) {
433
435
  }
434
436
  }
435
437
 
436
- .mui-textfield > .mui-textfield__input {
438
+ .mui-textfield > input,
439
+ .mui-textfield > textarea {
437
440
  &:invalid:not(:focus) {
438
441
  // Set label color to danger color
439
442
  &:not(:required),
@@ -444,10 +447,17 @@ input.mui-textfield__input:invalid:not(:focus) {
444
447
  color: $mui-danger-color;
445
448
  }
446
449
  }
447
-
448
- // Set label color to danger color for dirty, empty fields
449
- &:required.mui--is-empty.mui--is-dirty ~ label:not(.mui-textfield__label--floating) {
450
- color: $mui-danger-color;
450
+ }
451
+ }
452
+
453
+ .mui-textfield:not(.mui-textfield--float-label) {
454
+ > input,
455
+ > textarea {
456
+ &:invalid:not(:focus) {
457
+ // Set label color to danger color for dirty, empty fields
458
+ &:required.mui--is-empty.mui--is-dirty ~ label {
459
+ color: $mui-danger-color;
460
+ }
451
461
  }
452
462
  }
453
463
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mui-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Tarasov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass