Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shape): Integrate Shape API with more components #3552

Merged
merged 92 commits into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
af1202d
feat(shape): added shape APIs and updated README.
abhiomkar Aug 31, 2018
e9fea9c
feat(shape): Integrated shape APIs with button & card
abhiomkar Aug 31, 2018
4f326bc
feat(shape): Updated shape API to accept component height instead of …
abhiomkar Aug 31, 2018
e52d614
feat(shape): Removed old shape demos from here
abhiomkar Aug 31, 2018
114c74e
Merge branch 'feat/shape' into feat/shape_integrate
abhiomkar Aug 31, 2018
3967116
feat(shape): Added new shape demos here
abhiomkar Aug 31, 2018
da8151d
feat(shape): Updated shape categories
abhiomkar Aug 31, 2018
6920554
Merge branch 'feat/shape' into feat/shape_integrate
abhiomkar Aug 31, 2018
1fee295
feat(shape): Updated button & card styles for shapes
abhiomkar Aug 31, 2018
4118533
feat(shape): Updated shape pill resolve functions
abhiomkar Aug 31, 2018
6c6ccc1
feat(shape): Remove height info from shapes
abhiomkar Aug 31, 2018
b45e1d9
Merge branch 'feat/shape' into feat/shape_integrate
abhiomkar Aug 31, 2018
e6287a1
feat(shape): Update button to use its own height
abhiomkar Aug 31, 2018
b8d1c71
feat(shape): Updated README and mixins
abhiomkar Sep 10, 2018
c47a76a
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 10, 2018
30ec24d
feat(shape): Use prop-value function when validating radius
abhiomkar Sep 10, 2018
52a11db
Merge branch 'feat/shape' into feat/shape_api
abhiomkar Sep 10, 2018
0159b35
feat(shape): water
abhiomkar Sep 10, 2018
b4aa710
feat(shape): Updated shape demo for drawer
abhiomkar Sep 10, 2018
8d2ab36
feat(shape): Updated shape demo for card
abhiomkar Sep 10, 2018
1b6d580
feat(shape): Updated drawer mixin for shapes
abhiomkar Sep 10, 2018
b148d1d
feat(shape): Simplified shape mixin & functions
abhiomkar Sep 10, 2018
6fa02d4
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 10, 2018
ea30a2f
feat(shape): Updates to README
abhiomkar Sep 10, 2018
a544713
feat(shape): Added docs for functions.scss
abhiomkar Sep 10, 2018
eb55fcf
feat(shape): Minor doc updates
abhiomkar Sep 10, 2018
8094aea
feat(shape): Updates to shape category value
abhiomkar Sep 10, 2018
52036f1
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 10, 2018
789e631
feat(shape): added shape APIs and updated README.
abhiomkar Aug 31, 2018
645a644
feat(shape): Updated shape API to accept component height instead of …
abhiomkar Aug 31, 2018
93758b9
feat(shape): Removed old shape demos from here
abhiomkar Aug 31, 2018
fdba967
feat(shape): Updated shape categories
abhiomkar Aug 31, 2018
e15d2cc
feat(shape): Updated shape pill resolve functions
abhiomkar Aug 31, 2018
3a1de82
feat(shape): Remove height info from shapes
abhiomkar Aug 31, 2018
98dafb4
feat(shape): Updated README and mixins
abhiomkar Sep 10, 2018
d2f8495
feat(shape): Use prop-value function when validating radius
abhiomkar Sep 10, 2018
2b8e864
feat(shape): Simplified shape mixin & functions
abhiomkar Sep 10, 2018
dc4be29
feat(shape): Updates to README
abhiomkar Sep 10, 2018
4585758
feat(shape): Added docs for functions.scss
abhiomkar Sep 10, 2018
9f3a6dd
feat(shape): Minor doc updates
abhiomkar Sep 10, 2018
d68700d
feat(shape): Updates to shape category value
abhiomkar Sep 10, 2018
5bc0c39
feat(shape): Integrated shape API to card, button, drawer, image list…
abhiomkar Sep 11, 2018
82acafe
Merge branch 'feat/shape' into feat/shape_api
abhiomkar Sep 11, 2018
68b4794
feat(shape): Updated travis yml to include shape feat branch
abhiomkar Sep 11, 2018
25c434b
feat(shape): water
abhiomkar Sep 11, 2018
e1f507c
feat(shape): Updates to README
abhiomkar Sep 12, 2018
2047412
feat(shape): Updated README for functions
abhiomkar Sep 12, 2018
71c1e50
feat(shape): Added support for percentage
abhiomkar Sep 12, 2018
9c5f6f3
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 12, 2018
6745ff1
feat(shape): Updated shape API for percentage resolve
abhiomkar Sep 12, 2018
2c9d160
feat(shape): Updated docs for percentage radius changes
abhiomkar Sep 12, 2018
bac8ed1
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 12, 2018
b7bc84f
feat(shape): Updated README
abhiomkar Sep 12, 2018
d100ff1
feat(shape): Updated is-valid radius function for percentage radius
abhiomkar Sep 12, 2018
f85d500
feat(shape): Updated README to mention it supports only rounded
abhiomkar Sep 12, 2018
637fa38
feat(shape): Renamed global variables to include *-surface-* term
abhiomkar Sep 12, 2018
80da583
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 12, 2018
23d5afc
feat(shape): Updating menu surface for shapes WIP
abhiomkar Sep 12, 2018
82907e4
feat(shape): Updated drawer README for shape mixins
abhiomkar Sep 12, 2018
f4be5eb
feat(shape): Updated menu surface for shapes
abhiomkar Sep 12, 2018
3e47d27
feat(shape): Shape API for menu surface, notched outline, select
abhiomkar Sep 13, 2018
a633af1
feat(shape): Updated sass in screenshot test
abhiomkar Sep 13, 2018
5384732
feat(shape): Changes for review comments
abhiomkar Sep 13, 2018
7704f69
feat(shape): Added Shape API to text field
abhiomkar Sep 13, 2018
cc863ff
feat(shape): Added Shape API to fab
abhiomkar Sep 13, 2018
4ab04dd
feat(shape): Added Shape API to snackbar
abhiomkar Sep 13, 2018
7aebbd8
feat(shape): Added Shape API to top app bar short
abhiomkar Sep 13, 2018
96f1356
feat(shape): Updated select mixin to import _variables
abhiomkar Sep 13, 2018
faa032c
feat(shape): Reorganized README
abhiomkar Sep 13, 2018
13727a6
feat(shape): water
abhiomkar Sep 13, 2018
a571e9c
feat(shape): water
abhiomkar Sep 13, 2018
0de834a
feat(shape): Updated golden screenshots after updating button, card s…
abhiomkar Sep 13, 2018
3a3afc6
feat(shape): Code comment for extracting number from percentage
abhiomkar Sep 14, 2018
b3067cd
feat(list): Changes for review comments
abhiomkar Sep 17, 2018
8880528
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 17, 2018
25e7cfa
feat(shape): Changes for review comments
abhiomkar Sep 17, 2018
b5dc384
feat(shape): Made prop-value mixin private
abhiomkar Sep 17, 2018
a78451f
Merge branch 'feat/shape_api' into feat/shape_integrate
abhiomkar Sep 17, 2018
6ddf964
Merge branch 'feat/shape_integrate' into feat/shape_integrate_2
abhiomkar Sep 17, 2018
2cb4710
fix(shape): changes for review comments
abhiomkar Sep 19, 2018
839a6aa
fix(shape): mdc-shape-mask-radius new function & used in image list
abhiomkar Sep 20, 2018
96ec234
feat(shape): Water
abhiomkar Sep 20, 2018
9300ca6
WIP Add screenshot tests for standard image-list variant
Sep 20, 2018
65b450c
feat(shape): changes for review comments
abhiomkar Sep 21, 2018
81fa386
Merge branch 'feat/shape_integrate' into feat/shape_integrate_2
abhiomkar Sep 21, 2018
6c99e2c
feat(shape): Removed mask-top-radius is reused mask-radius instead
abhiomkar Sep 21, 2018
dfe6408
feat(shape): Text field text area mixin changes
abhiomkar Sep 21, 2018
42c6668
feat(shape): water
abhiomkar Sep 21, 2018
e65a145
Merge branch 'feat/shape' into feat/shape_integrate_2
abhiomkar Sep 21, 2018
dbf5a7a
feat(shape): Add shapes to dialog
abhiomkar Sep 21, 2018
b7ca944
feat(shape): Golden screenshots for dialog
abhiomkar Sep 21, 2018
30e5c7d
feat(shape): mini FAB uses height variable
abhiomkar Sep 21, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ branches:
# This prevents excessive resource usage and CI slowness.
only:
- master
- feat/shape

before_install:
# Source the scripts to export their env vars. See https://superuser.com/a/176788/62792
Expand Down
2 changes: 1 addition & 1 deletion demos/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ <h1 class="mdc-typography--headline3">Ripple Enabled</h1>
</fieldset>

<fieldset>
<legend class="mdc-typography--headline6">Custom button (Experimental)</legend>
<legend class="mdc-typography--headline6">Custom button</legend>
<div>
<button class="mdc-button mdc-button--unelevated big-round-corner-button">
Corner Radius
Expand Down
2 changes: 1 addition & 1 deletion demos/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

.mdc-button.big-round-corner-button {
@include mdc-button-corner-radius(8px);
@include mdc-button-shape-radius(8px);
}

.mdc-button.thick-outline-button {
Expand Down
6 changes: 1 addition & 5 deletions demos/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@
//

.demo-card--music {
@include mdc-card-corner-radius(24px 4px);

@include mdc-rtl {
@include mdc-card-corner-radius(4px 24px);
}
@include mdc-card-shape-radius((24px, 4px), $rtl-reflexive: true);
}

.demo-card__music-row {
Expand Down
2 changes: 1 addition & 1 deletion demos/image-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

.rounded-corners {
@include mdc-image-list-corner-radius(8px);
@include mdc-image-list-shape-radius(8px);
}

@media (max-width: 599px) {
Expand Down
8 changes: 0 additions & 8 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,6 @@
</span>
</a>

<a href="shape.html" role="listitem" class="mdc-list-item">
<span class="demo-catalog-list-icon mdc-list-item__graphic"><img src="/images/ic_component_24px.svg" /></span>
<span class="mdc-list-item__text">
<span class="mdc-list-item__primary-text">Shape</span>
<span class="mdc-list-item__secondary-text">Mixins for angled corners on unelevated components</span>
</span>
</a>

<a href="slider.html" role="listitem" class="mdc-list-item">
<span class="demo-catalog-list-icon mdc-list-item__graphic"><img src="/images/slider.svg" /></span>
<span class="mdc-list-item__text">
Expand Down
127 changes: 0 additions & 127 deletions demos/shape.html

This file was deleted.

100 changes: 0 additions & 100 deletions demos/shape.scss

This file was deleted.

4 changes: 2 additions & 2 deletions packages/mdc-button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ To style a contained button, add the `mdc-button--raised` class to the `<button>

To style an outlined button, add the class `mdc-button--outlined` to the `<button>` element.

### Icons
### Icons

To add an icon, add an element with the `mdc-button__icon` class inside the button element and set the attribute `aria-hidden="true"`. The icon is set to 18px to meet legibility requirements.

Expand Down Expand Up @@ -144,7 +144,7 @@ Mixin | Description
`mdc-button-container-fill-color($color)` | Sets the container fill color to the given color.
`mdc-button-icon-color($color)` | Sets the icon color to the given color.
`mdc-button-ink-color($color)` | Sets the ink color to the given color, and sets the icon color to the given color unless `mdc-button-icon-color` is also used.
`mdc-button-corner-radius($corner-radius)` | Sets the corner radius to the given number (defaults to 2px).
`mdc-button-shape-radius($radius, $rtl-reflexive)` | Sets rounded shape to button with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.
`mdc-button-horizontal-padding($padding)` | Sets horizontal padding to the given number.
`mdc-button-outline-color($color)` | Sets the outline color to the given color.
`mdc-button-outline-width($width, $padding)` | Sets the outline width to the given number (defaults to 2px) and adjusts padding accordingly. `$padding` is only required in cases where `mdc-button-horizontal-padding` is also included with a custom value.
Expand Down
10 changes: 8 additions & 2 deletions packages/mdc-button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
@import "@material/theme/functions";
@import "@material/theme/mixins";
@import "@material/typography/mixins";
@import "@material/shape/mixins";
@import "@material/shape/functions";
@import "./variables";

@mixin mdc-button-filled-accessible($container-fill-color) {
Expand Down Expand Up @@ -68,8 +70,12 @@
}
}

@mixin mdc-button-corner-radius($corner-radius) {
border-radius: $corner-radius;
@mixin mdc-button-shape-radius($radius, $rtl-reflexive: false) {
@include mdc-shape-radius(mdc-shape-resolve-percentage-radius($mdc-button-height, $radius), $rtl-reflexive);

&.mdc-button--dense {
@include mdc-shape-radius(mdc-shape-resolve-percentage-radius($mdc-dense-button-height, $radius), $rtl-reflexive);
}
}

@mixin mdc-button-horizontal-padding($padding) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-button/mdc-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// postcss-bem-linter: define button
.mdc-button {
@include mdc-button-base_;
@include mdc-button-corner-radius(2px);
@include mdc-button-shape-radius(small);
@include mdc-button-container-fill-color(transparent);
@include mdc-button-ink-color(primary);
@include mdc-states(primary);
Expand Down
3 changes: 2 additions & 1 deletion packages/mdc-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@material/ripple": "^0.39.3",
"@material/rtl": "^0.39.1",
"@material/theme": "^0.39.1",
"@material/typography": "^0.39.0"
"@material/typography": "^0.39.0",
"@material/shape": "^0.39.0"
}
}
2 changes: 1 addition & 1 deletion packages/mdc-card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ Mixin | Description
--- | ---
`mdc-card-fill-color($color)` | Sets the fill color of a card
`mdc-card-outline($color, $thickness)` | Sets the color and thickness of a card's outline (but does _not_ remove its shadow)
`mdc-card-corner-radius($radius)` | Sets the corner radius of a card
`mdc-card-shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to card with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.
`mdc-card-media-aspect-ratio($x, $y)` | Maintains the given aspect ratio on a `mdc-card__media` subelement by dynamically scaling its height relative to its width
5 changes: 3 additions & 2 deletions packages/mdc-card/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
//

@import "@material/theme/mixins";
@import "@material/shape/mixins";
@import "./variables";

//
Expand All @@ -35,8 +36,8 @@
border: $thickness solid mdc-theme-prop-value($color);
}

@mixin mdc-card-corner-radius($radius) {
border-radius: $radius;
@mixin mdc-card-shape-radius($radius, $rtl-reflexive: false) {
@include mdc-shape-radius($radius, $rtl-reflexive);
}

@mixin mdc-card-media-aspect-ratio($x, $y) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-card/mdc-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

.mdc-card {
@include mdc-card-fill-color(surface);
@include mdc-card-corner-radius(2px);
@include mdc-card-shape-radius(small);
@include mdc-elevation(2);
@include mdc-card-container-layout_;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/mdc-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@material/elevation": "^0.39.1",
"@material/ripple": "^0.39.3",
"@material/rtl": "^0.39.1",
"@material/theme": "^0.39.1"
"@material/theme": "^0.39.1",
"@material/shape": "^0.39.0"
}
}
Loading