Merge remote-tracking branch 'origin/master' into #11/description-for-input-components

# Conflicts:
#	src/styles/clay/_base.scss
This commit is contained in:
Keegan
2016-03-03 10:45:20 +11:00
5 changed files with 174 additions and 35 deletions
+34 -6
View File
@@ -18,6 +18,22 @@ function enable() {
return this.trigger('enabled');
}
/**
* @returns {ClayEvents}
*/
function hide() {
this.$element.set('+hide');
return this.trigger('hide');
}
/**
* @returns {ClayEvents}
*/
function show() {
this.$element.set('-hide');
return this.trigger('show');
}
module.exports = {
html: {
get: function() {
@@ -26,7 +42,9 @@ module.exports = {
set: function(value) {
this.$manipulatorTarget.set('innerHTML', value);
return this.trigger('change');
}
},
hide: hide,
show: show
},
val: {
get: function() {
@@ -37,7 +55,9 @@ module.exports = {
return this.trigger('change');
},
disable: disable,
enable: enable
enable: enable,
hide: hide,
show: show
},
checked: {
get: function() {
@@ -48,7 +68,9 @@ module.exports = {
return this.trigger('change');
},
disable: disable,
enable: enable
enable: enable,
hide: hide,
show: show
},
radiogroup: {
get: function() {
@@ -61,7 +83,9 @@ module.exports = {
return this.trigger('change');
},
disable: disable,
enable: enable
enable: enable,
hide: hide,
show: show
},
checkboxgroup: {
get: function() {
@@ -83,7 +107,9 @@ module.exports = {
return self.trigger('change');
},
disable: disable,
enable: enable
enable: enable,
hide: hide,
show: show
},
color: {
get: function() {
@@ -99,6 +125,8 @@ module.exports = {
return this.trigger('change');
},
disable: disable,
enable: enable
enable: enable,
hide: hide,
show: show
}
};
+42 -10
View File
@@ -17,7 +17,7 @@ html, body {
body {
background-color: $color-gray-2;
padding: $item-spacing-v $item-spacing-h;
padding: 0 $item-spacing-h $item-spacing-v;
}
em {
@@ -101,30 +101,47 @@ label {
}
}
.hide {
display: none !important;
}
.tap-highlight {
@include tap-highlight();
}
.component {
padding-bottom: $item-spacing-v;
padding-top: $item-spacing-v;
&.disabled {
opacity: 0.25;
pointer-events: none;
> * {
opacity: 0.25;
}
}
}
.section {
background: $color-gray-4;
border-radius: 0.25rem;
margin-bottom: 1rem;
box-shadow: $color-gray-1 0 0.15rem 0.25rem;
.component {
> .component {
padding-bottom: $item-spacing-v;
padding-right: $item-spacing-h;
padding-left: $item-spacing-h;
position: relative;
padding: $item-spacing-v $item-spacing-h;
margin-top: 1rem;
&:last-child:after {
&:not(.hide) ~ .component {
margin-top: 0;
}
&:last-child,
&:first-child {
padding-bottom: $item-spacing-v;
}
&:first-child:after {
display: none;
}
@@ -133,7 +150,7 @@ label {
background: $color-gray-6;
display: block;
position: absolute;
bottom: 0;
top: 0;
left: $item-spacing-h / 2;
right: $item-spacing-h / 2;
height: 1px;
@@ -141,13 +158,28 @@ label {
}
}
.component-heading:first-child {
// don't show the separator for the first non-hidden item
> .component:not(.hide):after {
display: none;
}
> .component:not(.hide) ~ .component:not(.hide):after {
display: block;
}
> .component-heading:first-child {
background: $color-gray-3;
border-radius: $border-radius $border-radius 0 0;
&:after {
// don't show the separator for the first non-hidden item after the heading
&:after,
~ .component:not(.hide):after {
display: none;
}
~ .component:not(.hide) ~ .component:not(.hide):after {
display: block;
}
}
}
-7
View File
@@ -34,14 +34,7 @@ $color-gray-9: #a4a4a4 ;
$color-gray-10: #ececec;
$color-gray-11: #f2f2f2;
$global-margin: 55px;
$form-margin: 25px;
$button-padding: 0.7rem;
$button-padding-ios: 0.6rem;
$button-line-height: 13px;
$footer-height-large: 90px;
$box-shadow-small-components: $color-gray-1 0 0.1rem 0.1rem;