Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 3205b33

Browse files
committed
fix(button): horizontal padding should match the spec
- left and right padding changed from `6px` to `8px` - add a demo for dense buttons Fixes #10535 BREAKING CHANGE: `md-button`'s internal horizontal padding has changed from `6px` to `8px` to match the Material Design spec. This may affect the layout of portions of your application where `md-button`, `md-datepicker`, or `md-toast` with actions are used. If you are using our SCSS files, you can override this back to the default, or another value, in your app's SCSS files: ```scss $button-left-right-padding: rem(0.600); // For 6px horizontal padding ``` fix(button): horizontal padding should match the spec - left and right padding changed from `6px` to `8px` Fixes #10535 BREAKING CHANGE: `md-button`'s internal horizontal padding has changed from `6px` to `8px` to match the Material Design spec. This may affect the layout of portions of your application where `md-button`, `md-datepicker`, or `md-toast` with actions are used. If you are using our SCSS files, you can override this back to the default, or another value, in your app's SCSS files: ```scss $button-left-right-padding: rem(0.600); // For 6px horizontal padding ```
1 parent 6e91c62 commit 3205b33

File tree

6 files changed

+58
-4
lines changed

6 files changed

+58
-4
lines changed

src/components/button/button.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// Material Design Button
2-
// https://material.google.com/components/buttons.html
1+
// Material Design Button: https://material.io/archive/guidelines/components/buttons.html
32

43
$button-border-radius: 2px !default;
54
$button-fab-border-radius: 50% !default;

src/components/button/demoBasicUsage/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
target="_blank"
8282
ng-disabled="true"
8383
aria-label="Google.com"
84-
class="md-icon-button launch" >
84+
class="md-icon-button launch">
8585
<md-icon md-svg-icon="img/icons/launch.svg"></md-icon>
8686
</md-button>
8787
<div class="label">Icon Button</div>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<div ng-controller="AppCtrl" ng-cloak>
2+
<md-content class="md-dense">
3+
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
4+
<md-button>Button</md-button>
5+
<md-button md-no-ink class="md-primary">Primary (md-noink)</md-button>
6+
<md-button ng-disabled="true" class="md-primary">Disabled</md-button>
7+
<md-button class="md-warn">Warn</md-button>
8+
<div class="label">Flat</div>
9+
</section>
10+
<md-divider></md-divider>
11+
12+
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
13+
<md-button class="md-raised">Button</md-button>
14+
<md-button class="md-raised md-primary">Primary</md-button>
15+
<md-button ng-disabled="true" class="md-raised md-primary">Disabled</md-button>
16+
<md-button class="md-raised md-accent">Accent</md-button>
17+
<div class="label">Raised</div>
18+
</section>
19+
<md-divider></md-divider>
20+
21+
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
22+
<md-button ng-href="{{googleUrl}}" target="_blank">Default Link</md-button>
23+
<md-button class="md-primary" ng-href="{{googleUrl}}" target="_blank">
24+
Primary Link
25+
</md-button>
26+
<md-button>Default Button</md-button>
27+
<div class="label">Link vs. Button</div>
28+
</section>
29+
<md-divider></md-divider>
30+
31+
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
32+
<md-button class="md-primary md-hue-2">Primary Hue 2</md-button>
33+
<md-button class="md-warn md-raised md-hue-1">Warn Hue 1</md-button>
34+
<md-button class="md-accent md-raised md-hue-2">Accent Hue 2</md-button>
35+
<md-button class="md-accent md-hue-3">Accent Hue 3</md-button>
36+
<div class="label">Themed</div>
37+
</section>
38+
</md-content>
39+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
angular.module('buttonsDemoDense', ['ngMaterial'])
2+
.controller('AppCtrl', function($scope) {
3+
$scope.isDisabled = true;
4+
$scope.googleUrl = 'http://google.com';
5+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
section {
2+
text-align: center;
3+
margin: 8px;
4+
position: relative !important;
5+
}
6+
.label {
7+
position: absolute;
8+
bottom: 5px;
9+
left: 7px;
10+
font-size: 12px;
11+
}

src/core/style/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $layout-breakpoint-md: 1280px !default;
3131
$layout-breakpoint-lg: 1920px !default;
3232

3333
// Button
34-
$button-left-right-padding: rem(0.600) !default;
34+
$button-left-right-padding: rem(0.800) !default;
3535

3636
// Icon
3737
$icon-size: rem(2.400) !default;

0 commit comments

Comments
 (0)