-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
refactor(notched-outline): Refactor notched outline to use 3 divs #4035
Changes from 63 commits
a17c736
d5c8b87
9f7118e
56b5690
ebbb08a
277b0b6
448f6db
3b39382
46d6eeb
6fe1882
7a0a26b
eff8812
86c2b8c
3520d1f
1b931f6
d02b300
bac20d3
daa35f3
fcee88f
4feda93
a05f6bd
6ee812a
6547c39
f320482
e4b0c0d
59651e8
a848d3b
71ea18b
28a9375
5455f94
333404b
8cbde9a
7027f18
63d6800
c5f2fe3
e95ae74
33f5cb7
44b594c
40a8252
342b98d
2544d6f
1241ce0
17095c5
bd6009f
fa6ce6a
e3eaf88
396c4eb
18c3f8c
c2b5805
1ef9676
0cdbf56
6779c07
e47e319
d04990f
438c8bc
1e04648
677c83a
013ae74
f27f8c2
d10994a
06b148a
7869033
e3da3e3
955ca04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,31 +22,56 @@ | |
|
||
@import "@material/theme/mixins"; | ||
@import "@material/shape/mixins"; | ||
|
||
@mixin mdc-notched-outline-idle-color($color) { | ||
.mdc-notched-outline__idle { | ||
@include mdc-theme-prop(border-color, $color); | ||
} | ||
} | ||
@import "@material/rtl/mixins"; | ||
@import "./variables"; | ||
|
||
@mixin mdc-notched-outline-color($color) { | ||
.mdc-notched-outline__path { | ||
@include mdc-theme-prop(stroke, $color); | ||
.mdc-notched-outline__leading, | ||
.mdc-notched-outline__notch, | ||
.mdc-notched-outline__trailing { | ||
@include mdc-theme-prop(border-color, $color); | ||
} | ||
} | ||
|
||
@mixin mdc-notched-outline-stroke-width($width) { | ||
.mdc-notched-outline__path { | ||
stroke-width: $width; | ||
.mdc-notched-outline__leading, | ||
.mdc-notched-outline__notch, | ||
.mdc-notched-outline__trailing { | ||
border-width: $width; | ||
} | ||
} | ||
|
||
@mixin mdc-notched-outline-shape-radius($radius, $rtl-reflexive: false) { | ||
@include mdc-shape-radius($radius, $rtl-reflexive); | ||
$radius: mdc-shape-prop-value($radius); | ||
|
||
.mdc-notched-outline__leading { | ||
@include mdc-shape-radius(mdc-shape-mask-radius($radius, 1 0 0 1), $rtl-reflexive: true); | ||
|
||
@if ($radius > $mdc-notched-outline-leading-width) { | ||
width: $radius; | ||
} | ||
} | ||
|
||
.mdc-notched-outline__trailing { | ||
@include mdc-shape-radius(mdc-shape-mask-radius($radius, 0 1 1 0), $rtl-reflexive: true); | ||
} | ||
} | ||
|
||
@mixin mdc-notched-outline-idle-shape-radius($radius, $rtl-reflexive: false) { | ||
.mdc-notched-outline__idle { | ||
@include mdc-shape-radius($radius, $rtl-reflexive); | ||
@mixin mdc-notched-outline-floating-label-float-position($positionY, $positionX: 0%, $scale: .75) { | ||
@include mdc-floating-label-float-position($positionY + $mdc-notched-outline-label-adjust, $positionX, 1); | ||
|
||
.mdc-floating-label--float-above { | ||
font-size: ($scale * 1rem); | ||
} | ||
|
||
// Two selectors to ensure we select the appropriate class when applied from this component or a parent component. | ||
&.mdc-notched-outline--upgraded, | ||
.mdc-notched-outline--upgraded { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the "calling mixins with parent selectors" part of the readme since it was obsolete as written... however, this particular mixin still operates under the assumption that the context is a parent, otherwise this selector won't match. On the other hand, if we were to revise this to We could potentially include both selectors ( Typically we set the expectation that applying a mixin to the root class of its component will work. We do make this sort of assumption in a few other places (I searched for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll make a quick commit adding both selectors and see if it changes anything. |
||
@include mdc-floating-label-float-position($positionY, $positionX, $scale); | ||
|
||
// stylelint-disable-next-line no-descending-specificity | ||
.mdc-floating-label--float-above { | ||
font-size: 1rem; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@williamernest @kfranqueiro This line in the documentation still mentions SVG despite the notched outline not using SVG anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, I knew I was still going to miss something in the README. Thanks for pointing it out.