From 21e2f3c1dbfb2a0eac5e954535a12282294cfdf9 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Thu, 30 Jul 2015 17:25:32 -0700 Subject: [PATCH] chore(button): dramatically clean-up button css. --- .../src/components/button/button.scss | 416 +++++------------- .../src/components/button/button.ts | 2 +- .../src/core/style/shadows.scss | 8 +- .../src/core/style/theme-functions.scss | 6 + .../src/core/style/variables.scss | 5 + .../src/material/button/demo_app.html | 42 +- 6 files changed, 149 insertions(+), 330 deletions(-) diff --git a/modules/angular2_material/src/components/button/button.scss b/modules/angular2_material/src/components/button/button.scss index aa73c6d3a6..68f45f2a77 100644 --- a/modules/angular2_material/src/components/button/button.scss +++ b/modules/angular2_material/src/components/button/button.scss @@ -4,23 +4,24 @@ // TODO(jelbourn): This goes away. @import "../../core/style/default-theme"; -$button-line-height: 25px !default; -$button-padding: 2px 6px 3px !default; -// Fab buttons -$button-fab-width: 56px !default; -$button-fab-height: 56px !default; -$button-fab-padding: 16px !default; -$button-fab-mini-width: 40px !default; -$button-fab-mini-height: 40px !default; +// Standard button sizing. +$md-button-padding: 0 rem(0.600) !default; +$md-button-min-width: rem(8.800) !default; +$md-button-margin: rem(0.600) rem(0.800) !default; +$md-button-line-height: rem(3.60) !default; +$md-button-border-radius: 3px !default; -$button-fab-toast-offset: $button-fab-height * 0.75; +// FAB sizing. +$md-fab-size: rem(5.600) !default; +$md-fab-line-height: rem(5.600) !default; +$md-fab-padding: rem(1.60) !default; +$md-fab-mini-size: rem(4.00) !default; +$md-fab-mini-line-height: rem(4.00) !default; -/** - * Mixin to create distinct classes for fab positions, e.g. ".md-fab-bottom-right". - */ -@mixin fab-position($spot, $top: auto, $right: auto, $bottom: auto, $left: auto) { - &.md-fab-#{$spot} { +/** Mixin to create distinct classes for fab positions, e.g. ".md-fab-bottom-right". */ +@mixin md-fab-position($spot, $top: auto, $right: auto, $bottom: auto, $left: auto) { + .md-fab-position-#{$spot} { top: $top; right: $right; bottom: $bottom; @@ -29,321 +30,140 @@ $button-fab-toast-offset: $button-fab-height * 0.75; } } -[md-button] { - user-select: none; +// Base styles for all buttons. +@mixin md-button-base() { + box-sizing: border-box; + position: relative; + display: inline-block; - // TODO(jelbourn): What canvas? - position: relative; //for child absolute-positioned - - outline: none; - border: 0; - padding: 6px; - margin: 0; - background: transparent; - white-space: nowrap; - - text-align: center; - - // TODO(jelbourn): wat? + font-size: $md-body-font-size-base; font-weight: 500; - font-style: inherit; - font-variant: inherit; - font-size: inherit; - font-family: inherit; - line-height: inherit; + + // Reset browser - - - - + + + + +
Fab button - - - - - + + + + +
Anchor / hyperlink HREF DISABLED HREF - RAISED HREF + RAISED HREF