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 all 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
2 changes: 1 addition & 1 deletion packages/mdc-dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Mixin | Description
`mdc-dialog-title-ink-color($color, $opacity)` | Sets the color of the dialog's title text.
`mdc-dialog-content-ink-color($color, $opacity)` | Sets the color of the dialog's content text.
`mdc-dialog-scroll-divider-color($color, $opacity)` | Sets the color of the dividers which display around scrollable content.
`mdc-dialog-corner-radius($radius)` | Sets the corner radius to the given amount (defaults to 4px on all sides).
`mdc-dialog-shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to dialog surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.
`mdc-dialog-min-width($min-width)` | Sets the minimum width of the dialog (defaults to 280px).
`mdc-dialog-max-width($max-width, $margin)` | Sets the maximum width of the dialog (defaults to 560px max width and 16px margins).
`mdc-dialog-max-height($max-height, $margin)` | Sets the maximum height of the dialog (defaults to no max height and 16px margins).
Expand Down
5 changes: 3 additions & 2 deletions packages/mdc-dialog/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// THE SOFTWARE.
//

@import "@material/shape/mixins";
@import "@material/theme/mixins";
@import "@material/theme/variables"; // for mdc-theme-prop-value

Expand Down Expand Up @@ -58,9 +59,9 @@
}
}

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

Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-dialog/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,4 @@ $mdc-dialog-max-width: 560px;
$mdc-dialog-margin: 16px;
$mdc-dialog-title-bottom-padding: 9px;

$mdc-dialog-corner-radius: 4px;

$mdc-dialog-z-index: 7;
2 changes: 1 addition & 1 deletion packages/mdc-dialog/mdc-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@include mdc-dialog-min-width($mdc-dialog-min-width);
@include mdc-dialog-max-width($mdc-dialog-max-width, $mdc-dialog-margin);
@include mdc-dialog-max-height(null, $mdc-dialog-margin);
@include mdc-dialog-corner-radius($mdc-dialog-corner-radius);
@include mdc-dialog-shape-radius(medium);

// Use `display: none` instead of `visibility: hidden` to avoid recalculating layout when the dialog is closed.
display: none;
Expand Down
1 change: 1 addition & 0 deletions packages/mdc-dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@material/ripple": "^0.39.3",
"@material/rtl": "^0.39.1",
"@material/theme": "^0.39.1",
"@material/shape": "^0.39.0",
"@material/typography": "^0.39.0",
"focus-trap": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/mdc-fab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Mixin | Description
`mdc-fab-ink-color($color)` | Sets the ink color to the given color
`mdc-fab-extended-padding($icon-padding, $label-padding)` | Sets the padding on both sides of the icon, and between the label and the edge of the FAB. In cases where there is no icon, `$label-padding` will apply to both sides.
`mdc-fab-extended-label-padding($label-padding)` | Sets the label side padding for Extended FAB. Useful when styling an Extended FAB with no icon.
`mdc-fab-shape-radius($radius, $rtl-reflexive)` | Sets rounded shape to all FAB variants with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.

The ripple effect for the FAB component is styled using [MDC Ripple](../mdc-ripple) mixins.

Expand Down
28 changes: 20 additions & 8 deletions packages/mdc-fab/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
@import "@material/ripple/variables";
@import "@material/theme/functions";
@import "@material/theme/mixins";
@import "@material/shape/mixins";
@import "@material/shape/functions";
@import "@material/rtl/mixins";
@import "./variables";

Expand Down Expand Up @@ -86,29 +88,40 @@
padding: 0 $label-padding;
}

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

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

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

$mdc-fab-icon-enter-delay_: 90ms;
$mdc-fab-icon-enter-duration_: 180ms;
$mdc-fab-extended-height_: 48px;

@mixin mdc-fab-base_ {
@include mdc-ripple-surface;
@include mdc-ripple-radius-bounded;
@include mdc-elevation(6);
@include mdc-fab-shape-radius(50%);

display: inline-flex;
position: relative;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 56px;
height: 56px;
width: $mdc-fab-height;
height: $mdc-fab-height;
padding: 0;
transition:
box-shadow $mdc-elevation-transition-duration $mdc-elevation-transition-timing-function,
opacity 15ms linear 30ms,
mdc-animation-enter(transform, $mdc-fab-icon-enter-duration_ + $mdc-fab-icon-enter-delay_);
border: none;
border-radius: 50%;
fill: currentColor;
cursor: pointer;
user-select: none;
Expand Down Expand Up @@ -155,8 +168,8 @@ $mdc-fab-extended-height_: 48px;
}

@mixin mdc-fab--mini_ {
width: 40px;
height: 40px;
width: $mdc-fab-mini-height;
height: $mdc-fab-mini-height;
}

@mixin mdc-fab--extended_ {
Expand All @@ -167,8 +180,7 @@ $mdc-fab-extended-height_: 48px;

width: auto;
max-width: 100%;
height: $mdc-fab-extended-height_;
border-radius: $mdc-fab-extended-height_ / 2;
height: $mdc-fab-extended-height;
}

@mixin mdc-fab__icon_ {
Expand Down
3 changes: 3 additions & 0 deletions packages/mdc-fab/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

$mdc-fab-extended-icon-padding: 12px;
$mdc-fab-extended-label-padding: 20px;
$mdc-fab-height: 56px;
$mdc-fab-mini-height: 40px;
abhiomkar marked this conversation as resolved.
Show resolved Hide resolved
$mdc-fab-extended-height: 48px;
1 change: 1 addition & 0 deletions packages/mdc-fab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@material/ripple": "^0.39.3",
"@material/rtl": "^0.39.1",
"@material/theme": "^0.39.1",
"@material/shape": "^0.39.0",
"@material/typography": "^0.39.0"
}
}
8 changes: 4 additions & 4 deletions packages/mdc-menu-surface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ menuSurface.setFixedPosition(true);

#### Absolute Position

The menu surface can use absolute positioning when being displayed. This requires that the element containing the
menu(`body` if using `hoistMenuToBody()`) has the `position: relative` style.
The menu surface can use absolute positioning when being displayed. This requires that the element containing the
menu (`body` if using `hoistMenuToBody()`) has the `position: relative` style.

```html
<div class="mdc-menu-surface">
Expand Down Expand Up @@ -146,7 +146,7 @@ Mixin | Description
--- | ---
`mdc-menu-surface-ink-color($color)` | Sets the `color` property of the `mdc-menu-surface`.
`mdc-menu-surface-fill-color($color)` | Sets the `background-color` property of the `mdc-menu-surface`.
`mdc-menu-surface-corner-radius($radius)` | Sets the `border-radius` property of the `mdc-menu-surface`.
`mdc-menu-surface-shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to menu surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.

## `MDCMenuSurface` Properties and Methods

Expand Down Expand Up @@ -216,7 +216,7 @@ Method Signature | Description
`setAbsolutePosition(x: number, y: numnber) => void` | Sets the absolute x/y position of the menu. Should only be used when the menu is hoisted or using fixed positioning.
`handleBodyClick(event: Event) => void` | Method used as the callback function for the `click` event.
`handleKeydown(event: Event) => void` | Method used as the callback function for the `keydown` events.
`open() => void` | Opens the menu surface.
`open() => void` | Opens the menu surface.
`close() => void` | Closes the menu.
`isOpen() => boolean` | Returns a boolean indicating whether the menu surface is open.
`setQuickOpen(quickOpen: boolean) => void` | Sets whether the menu surface should open and close without animation when the `open`/`close` methods are called.
5 changes: 3 additions & 2 deletions packages/mdc-menu-surface/_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";

@mixin mdc-menu-surface-ink-color($color) {
@include mdc-theme-prop(color, $color);
Expand All @@ -30,6 +31,6 @@
@include mdc-theme-prop(background-color, $color);
}

@mixin mdc-menu-surface-corner-radius($radius) {
border-radius: $radius;
@mixin mdc-menu-surface-shape-radius($radius, $rtl-reflexive: false) {
@include mdc-shape-radius($radius, $rtl-reflexive);
}
2 changes: 1 addition & 1 deletion packages/mdc-menu-surface/mdc-menu-surface.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@include mdc-menu-surface-fill-color(surface);
@include mdc-menu-surface-ink-color(on-surface);
@include mdc-rtl-reflexive-property(transform-origin, top left, top right);
@include mdc-menu-surface-corner-radius(4px);
@include mdc-menu-surface-shape-radius(medium);

display: none;
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions packages/mdc-menu-surface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@material/base": "^0.39.0",
"@material/elevation": "^0.39.1",
"@material/rtl": "^0.39.1",
"@material/shape": "^0.39.0",
"@material/theme": "^0.39.1"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/mdc-notched-outline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ Mixin | Description
`mdc-notched-outline-color($color)` | Customizes the border color of the notched outlined.
`mdc-notched-outline-idle-color($color)` | Customizes the border color of the idle outline.
`mdc-notched-outline-stroke-width($width)` | Changes notched outline width to a specified pixel value.
`mdc-notched-outline-corner-radius($radius)` | Sets the corner radius of the notched outline element to the given number.
`mdc-notched-outline-idle-corner-radius($radius)` | Sets the corner radius of the notched outline element in idle state.
`mdc-notched-outline-shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to notched outline element with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.
`mdc-notched-outline-idle-shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to notched outline element in idle state with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.

#### Calling Mixins with Parent Selectors

Expand Down
9 changes: 5 additions & 4 deletions packages/mdc-notched-outline/_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";

@mixin mdc-notched-outline-idle-color($color) {
.mdc-notched-outline__idle {
Expand All @@ -40,12 +41,12 @@
}
}

@mixin mdc-notched-outline-corner-radius($radius) {
border-radius: $radius;
@mixin mdc-notched-outline-shape-radius($radius, $rtl-reflexive: false) {
abhiomkar marked this conversation as resolved.
Show resolved Hide resolved
@include mdc-shape-radius($radius, $rtl-reflexive);
}

@mixin mdc-notched-outline-idle-corner-radius($radius) {
@mixin mdc-notched-outline-idle-shape-radius($radius, $rtl-reflexive: false) {
.mdc-notched-outline__idle {
border-radius: $radius;
@include mdc-shape-radius($radius, $rtl-reflexive);
}
}
1 change: 1 addition & 0 deletions packages/mdc-notched-outline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@material/animation": "^0.39.0",
"@material/base": "^0.39.0",
"@material/rtl": "^0.39.1",
"@material/shape": "^0.39.0",
"@material/theme": "^0.39.1"
}
}
4 changes: 2 additions & 2 deletions packages/mdc-select/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ Mixin | Description
`mdc-select-focused-label-color($color)` | Customizes the label color of the select when focused.
`mdc-select-bottom-line-color($color)` | Customizes the color of the default bottom line of the select.
`mdc-select-focused-bottom-line-color($color)` | Customizes the color of the bottom line of the select when focused.
`mdc-select-corner-radius($radius)` | Customizes the corner radius of the filled variant of the select.
`mdc-select-shape-radius($radius, $rtl-reflexive)` | Sets rounded shape to boxed select variant with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.
`mdc-select-hover-bottom-line-color($color)` | Customizes the color of the bottom line when the select is hovered.
`mdc-select-outline-color($color)` | Customizes the color of the notched outline.
`mdc-select-outline-corner-radius($radius)` | Sets the border radius of of the outlined select variant.
`mdc-select-outline-shape-radius($radius, $rtl-reflexive)` | Sets the border radius of of the outlined select variant. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.
`mdc-select-focused-outline-color($color)` | Customizes the color of the outline of the select when focused.
`mdc-select-hover-outline-color($color)` | Customizes the color of the outline when the select is hovered.

Expand Down
25 changes: 20 additions & 5 deletions packages/mdc-select/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@

@import "@material/floating-label/mixins";
@import "@material/theme/mixins";
@import "@material/shape/mixins";
@import "@material/shape/functions";
@import "@material/line-ripple/mixins";
@import "@material/notched-outline/mixins";
@import "./variables";

// Public

Expand Down Expand Up @@ -89,22 +92,34 @@
}
}

@mixin mdc-select-corner-radius($radius) {
border-radius: $radius $radius 0 0;
@mixin mdc-select-shape-radius($radius, $rtl-reflexive: false) {
@if length($radius) > 2 {
@error "Invalid radius: '#{$radius}' component doesn't allow customizing all corners";
}

$masked-radius: mdc-shape-mask-radius($radius, 1 1 0 0);

&, &__native-control {
@include mdc-shape-radius(mdc-shape-resolve-percentage-radius($mdc-select-height, $masked-radius), $rtl-reflexive);
}
}

@mixin mdc-select-outline-corner-radius($radius) {
@mixin mdc-select-outline-shape-radius($radius, $rtl-reflexive: false) {
// NOTE: idle and notched state border radius mixins
// are broken into 2 different mixins, otherwise
// we would be overly specific (big no, no). The cause of
// this is because .mdc-notched-outline and .mdc-notched-outline__idle
// are siblings. .mdc-notched-outline__idle needs to be a child of
// .mdc-notched-outline in order to remedy this issue.
.mdc-notched-outline {
@include mdc-notched-outline-corner-radius($radius);
@include mdc-notched-outline-shape-radius(mdc-shape-resolve-percentage-radius($mdc-select-height, $radius), $rtl-reflexive);
}

@include mdc-notched-outline-idle-corner-radius($radius);
@include mdc-notched-outline-idle-shape-radius(mdc-shape-resolve-percentage-radius($mdc-select-height, $radius), $rtl-reflexive);

&__native-control {
@include mdc-shape-radius(mdc-shape-resolve-percentage-radius($mdc-select-height, $radius), $rtl-reflexive);
}
}

// Private
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-select/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

$mdc-select-arrow-padding: 26px;
$mdc-select-label-padding: 16px;
$mdc-select-border-radius: 4px;
$mdc-select-height: 56px;

$mdc-select-ink-color: rgba(mdc-theme-prop-value(on-surface), .87);
$mdc-select-dropdown-color: mdc-theme-prop-value(on-surface);
Expand Down
7 changes: 3 additions & 4 deletions packages/mdc-select/mdc-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
@include mdc-select-ink-color($mdc-select-ink-color);
@include mdc-select-label-color($mdc-select-label-color);
@include mdc-select-bottom-line-color($mdc-select-bottom-line-idle-color);
@include mdc-select-shape-radius(medium);

// Focused state colors
@include mdc-select-focused-bottom-line-color(primary);
Expand All @@ -58,8 +59,7 @@
display: inline-flex;
position: relative;
box-sizing: border-box;
height: 56px;
border-radius: 4px 4px 0 0;
height: $mdc-select-height;
background-repeat: no-repeat;
background-position: right 10px center;
overflow: hidden;
Expand Down Expand Up @@ -100,7 +100,6 @@
padding-bottom: 4px;
border: none;
border-bottom: 1px solid;
border-radius: 4px 4px 0 0;
outline: none;
background-color: transparent;
color: inherit; // Override default user agent stylesheet
Expand All @@ -124,7 +123,7 @@
@include mdc-select-focused-outline-color(primary);
@include mdc-floating-label-float-position($mdc-select-outlined-label-position-y);
@include mdc-floating-label-shake-animation(text-field-outlined);
@include mdc-select-outline-corner-radius($mdc-select-border-radius);
@include mdc-select-outline-shape-radius(medium);
@include mdc-states-base-color(transparent);
@include mdc-select-container-fill-color(transparent);

Expand Down
1 change: 1 addition & 0 deletions packages/mdc-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@material/ripple": "^0.39.3",
"@material/rtl": "^0.39.1",
"@material/theme": "^0.39.1",
"@material/shape": "^0.39.0",
"@material/typography": "^0.39.0"
}
}
1 change: 0 additions & 1 deletion packages/mdc-shape/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Function | Description
--- | ---
`mdc-shape-flip-radius($radius)` | Flips the radius values in RTL context. `$radius` is list of 2-4 corner values.
`mdc-shape-resolve-percentage-radius($component-height, $radius)` | Calculates the absolute radius value based on its component height. Use this for fixed height components only.
`mdc-shape-mask-top-radius($radius)` | Accepts radius number or list of 2 radius values and returns 4 value list with top-left value, top-right value, bottom-right 0, bottom-left 0. Throws error when length of radius is more than 2.
`mdc-shape-mask-radius($radius, $masked-corners)` | Accepts radius number or list of 2-4 radius values and returns 4 value list with masked corners as mentioned in `$masked-corners`.

### Additional Information
Expand Down
Loading