diff --git a/gulpfile.js b/gulpfile.js index b2ea922779..3d1927a3a9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -294,6 +294,17 @@ gulp.task('sass', function() { .pipe(gulp.dest('dist/css/')); }); +gulp.task('sass.dark', function() { + return gulp.src('scripts/build/ionic.dark.scss') + .pipe(sass({ + onError: function(err) { + console.log(err) + } + })) + .pipe(autoprefixer(buildConfig.autoprefixer)) + .pipe(gulp.dest('dist/css/')); +}); + gulp.task('fonts', function() { return gulp.src('ionic/components/icon/fonts/**/*') .pipe(gulp.dest('dist/fonts')); diff --git a/ionic/components/app/colors.scss b/ionic/components/app/colors.scss deleted file mode 100644 index c42a35a602..0000000000 --- a/ionic/components/app/colors.scss +++ /dev/null @@ -1,66 +0,0 @@ - -// App Colors -// -------------------------------------------------- -// Color values and names can be changed here -// inverse: A color that looks good as a foreground to the base -// -// Use get-color($style, base/inverse) to grab - - -$colors: ( - - - // Brand colors - // ---------------------- - primary: ( - base: #387ef5, - light: #387ef5, - inverse: #fff - ), - - secondary: ( - base: #32db64, - light: #32db64, - inverse: #fff - ), - - - // Action Colors - // ---------------------- - danger: ( - base: #f53d3d, - light: #f53d3d, - inverse: #fff, - ), - - - // Shade Colors - // ---------------------- - light: ( - base: #fff, - light: #ddd, - inverse: #444, - ), - - stable: ( - base: #f4f4f4, - light: #888, - inverse: #444, - ), - - dark: ( - base: #222, - light: #222, - inverse: #fff, - ), - - -) !default; - - - -// Placeholder Colors -// -------------------------------------------------- -// Default colors which are meant to be overridden - -$placeholder-background: #f9f9f9 !default; diff --git a/ionic/components/button/button-clear.scss b/ionic/components/button/button-clear.scss new file mode 100644 index 0000000000..1f246e7c60 --- /dev/null +++ b/ionic/components/button/button-clear.scss @@ -0,0 +1,48 @@ + +// Clear Button +// -------------------------------------------------- + +button, +[button] { + + &[clear] { + border-color: transparent; + background: transparent; + color: darken-or-lighten($button-color); + + &.activated { + opacity: 0.4; + } + } + +} + + +// Clear Button Color Mixin +// -------------------------------------------------- + +@mixin button-clear($fg-color) { + + &[clear] { + border-color: transparent; + background: transparent; + color: $fg-color; + } + +} + + +// Generate Clear Button Colors +// -------------------------------------------------- + +@each $color, $value in auxiliary-colors() { + + button[#{$color}], + [button][#{$color}] { + + $fg-color: darken-or-lighten($value); + @include button-clear($fg-color); + + } + +} diff --git a/ionic/components/button/button-outline.scss b/ionic/components/button/button-outline.scss new file mode 100644 index 0000000000..3c2d36dd42 --- /dev/null +++ b/ionic/components/button/button-outline.scss @@ -0,0 +1,55 @@ + +// Outline Button +// -------------------------------------------------- + +button, +[button] { + + &[outline] { + border: 1px solid $button-color; + background: $background-color; + color: $button-color; + + &.activated { + opacity: 1; + color: $background-color; + background-color: $button-color; + } + } + +} + + +// Outline Button Color Mixin +// -------------------------------------------------- + +@mixin button-outline($fg-color) { + + &[outline] { + border-color: $fg-color; + background: $background-color; + color: $fg-color; + + &.activated { + color: $background-color; + background-color: $fg-color; + } + } + +} + + +// Outline Clear Button Colors +// -------------------------------------------------- + +@each $color, $value in auxiliary-colors() { + + button[#{$color}], + [button][#{$color}] { + + $fg-color: darken-or-lighten($value); + @include button-outline($fg-color); + + } + +} diff --git a/ionic/components/button/button-size.scss b/ionic/components/button/button-size.scss new file mode 100644 index 0000000000..a1800e0d4a --- /dev/null +++ b/ionic/components/button/button-size.scss @@ -0,0 +1,31 @@ + +// Button Sizes +// -------------------------------------------------- + +$button-large-font-size: 2rem !default; +$button-large-height: 5.4rem !default; +$button-large-padding: 1.4rem !default; + +$button-small-font-size: 1.3rem !default; +$button-small-height: 2.8rem !default; +$button-small-padding: 1.1rem !default; + + +button, +[button] { + + &[large] { + padding: 0 $button-large-padding; + min-width: ($button-large-padding * 4); + min-height: $button-large-height; + font-size: $button-large-font-size; + } + + &[small] { + padding: 0 $button-small-padding; + min-width: ($button-small-padding * 3); + min-height: $button-small-height; + font-size: $button-small-font-size; + } + +} diff --git a/ionic/components/button/button.scss b/ionic/components/button/button.scss index 8845f5be72..35a6ec5db4 100644 --- a/ionic/components/button/button.scss +++ b/ionic/components/button/button.scss @@ -1,5 +1,5 @@ -// Core Button Variables +// Button Variables // -------------------------------------------------- $button-font-size: 1.6rem !default; @@ -9,19 +9,16 @@ $button-height: 4.4rem !default; $button-border-width: 1px !default; $button-border-radius: 4px !default; -$button-large-font-size: 2rem !default; -$button-large-height: 5.4rem !default; -$button-large-padding: 1.4rem !default; - -$button-small-font-size: 1.3rem !default; -$button-small-height: 2.8rem !default; -$button-small-padding: 1.1rem !default; - $button-round-border-radius: 64px !default; $button-round-padding: 0 2.6rem !default; +$button-color: color(primary) !default; +$button-color-activated: darken-or-lighten($button-color) !default; +$button-text-color: inverse(primary) !default; +$button-hover-opacity: 0.88 !default; -// Core Button + +// Default Button // -------------------------------------------------- button, @@ -33,7 +30,8 @@ button, align-items: center; justify-content: center; - will-change: transform; + will-change: background-color, opacity; + transition: background-color, opacity 100ms linear; margin: $button-margin; line-height: 1; @@ -58,46 +56,30 @@ button, padding: $button-padding; min-height: $button-height; - background: transparent; - text-align: center; font-size: $button-font-size; border: transparent; border-radius: $button-border-radius; - &[large] { - padding: 0 $button-large-padding; - min-width: ($button-large-padding * 4); - min-height: $button-large-height; - font-size: $button-large-font-size; + background: $button-color; + color: $button-text-color; + + &:hover, + &.hover { + opacity: $button-hover-opacity; + color: $button-text-color; + text-decoration: none; } - &[small] { - padding: 0 $button-small-padding; - min-width: ($button-small-padding * 3); - min-height: $button-small-height; - font-size: $button-small-font-size; + &.activated { + opacity: 1; + background-color: $button-color-activated; } - // Core Button Types + // Button Types // -------------------------------------------------- - &[clear] { - border-color: transparent; - background: none; - } - - &[outline] { - background: none; - - &[full] { - border-radius: 0; - border-right-width: 0; - border-left-width: 0; - } - } - &[block] { display: flex; clear: both; @@ -117,13 +99,12 @@ button, border-radius: 0; border-right-width: 0; border-left-width: 0; - } - &.disabled, - &[disabled] { - opacity: .4; - cursor: default !important; - pointer-events: none; + &[outline] { + border-radius: 0; + border-right-width: 0; + border-left-width: 0; + } } &[round] { @@ -131,6 +112,13 @@ button, padding: $button-round-padding; } + &.disabled, + &[disabled] { + opacity: 0.4; + cursor: default !important; + pointer-events: none; + } + } @@ -139,88 +127,38 @@ button, margin-top: 0; } - -// Button Misc -// -------------------------------------------------- - a[button] { color: inherit; text-decoration: none; } -// Core Button Mixins +// Default Button Color Mixin // -------------------------------------------------- -@mixin button-default($bg-color, $fg-color) { +@mixin button-default($bg-color, $bg-color-activated, $text-color) { background-color: $bg-color; - color: $fg-color; - transition: background-color,opacity 100ms linear; - - &[full][outline] { - border-radius: 0; - border-right-width: 0; - border-left-width: 0; - } - - &:hover, - &.hover { - opacity: 0.88; - color: $fg-color; - text-decoration: none; - } + color: $text-color; &.activated { - opacity: 1; - background-color: darken($bg-color, 12%); - } -} - -@mixin button-clear($fg-color) { - &[clear] { - color: $fg-color; - background: none; - - &.activated { - opacity: 0.4; - } - } -} - -@mixin button-outline($fg-color) { - &[outline] { - border: 1px solid $fg-color; - background: transparent; - color: $fg-color; - - &.activated { - color: white; - background-color: rgb(red($fg-color), green($fg-color), blue($fg-color)); - } + background-color: $bg-color-activated; } } -// Core Button Color Generation +// Generate Default Button Colors // -------------------------------------------------- -@each $color, $value in $colors { +@each $color, $value in auxiliary-colors() { button[#{$color}], [button][#{$color}] { - @if lightness(get-color($color, base)) > 90 { - $fg-color: get-color($color, inverse); - } @else { - $fg-color: get-color($color, base); - } + $bg-color: $value; + $bg-color-activated: darken-or-lighten($bg-color); + $text-color: inverse($color); + @include button-default($bg-color, $bg-color-activated, $text-color); - @include button-default(get-color($color, base), - get-color($color, inverse)); - - @include button-clear($fg-color); - - @include button-outline(get-color($color, light)); } } diff --git a/ionic/components/button/test/basic/main.html b/ionic/components/button/test/basic/main.html index 9507319f4b..fdf67d56c6 100644 --- a/ionic/components/button/test/basic/main.html +++ b/ionic/components/button/test/basic/main.html @@ -1,5 +1,9 @@ -
@@ -7,12 +11,6 @@
-- - - -
-@@ -31,16 +29,10 @@
-- - - -
--
a[button][block] @@ -21,4 +25,4 @@
-@@ -7,12 +11,6 @@
-- - - -
-@@ -31,16 +29,10 @@
-- - - -
--
-
-
-
-
-
+
+
+