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

chore(notched-outline): separate outline from text-field #2326

Merged
merged 86 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a9d6c3c
chore(floating-label): moved floating-label to new package and integr…
Feb 6, 2018
9b750cd
chore(floating-label): changed all css classes to floating-label
Feb 7, 2018
4b01134
Merge branch 'master' into chore/text-field/decouple-label
Feb 8, 2018
5a4500f
fix(floating-label): fixed all tests
Feb 8, 2018
324a638
chore(floating-label): created test directory
Feb 8, 2018
51f16f6
fix(floating-label): removed label foundation from text-field
Feb 9, 2018
af02b19
Merge branch 'master' into chore/text-field/decouple-label
Feb 10, 2018
6f9abdf
fix(floating-label): tests
Feb 12, 2018
028c00d
Merge branch 'master' into chore/text-field/decouple-label
Feb 12, 2018
024ff39
fix(floating-label): updated readmes to reflect changes to floating-l…
Feb 12, 2018
2f72c61
fix(floating-label): closure annotation
Feb 12, 2018
c2f6b95
Merge branch 'master' into chore/text-field/decouple-label
Feb 12, 2018
f452125
chore(floating-label): moved text-field-placeholder css rule into tex…
Feb 12, 2018
f00ef39
Merge branch 'chore/text-field/decouple-label' of github.com:material…
Feb 12, 2018
4a9846c
chore(text-field): moved invalid label keyframe animation shakes to t…
Feb 13, 2018
1f2cf62
fix(text-field): removed export of floating label
Feb 13, 2018
ab8b035
Merge branch 'master' into chore/text-field/decouple-label
Feb 13, 2018
040f739
fix(text-field): closure annotations
Feb 13, 2018
d3871a3
Merge branch 'chore/text-field/decouple-label' of github.com:material…
Feb 15, 2018
252ffc4
Merge branch 'master' into chore/text-field/decouple-label
Feb 15, 2018
43bd881
fix(floating-label): sass compliation failure
Feb 15, 2018
9b627e2
fix(text-field): updated foundation methods to guard against !hasLabe…
Feb 16, 2018
808b6ff
Merge branch 'master' into chore/text-field/decouple-label
Feb 16, 2018
bed6857
Merge branch 'master' into chore/text-field/decouple-label
Feb 16, 2018
2c1c55e
fix(text-field): changed floating-label ink color mixin and updated t…
Feb 16, 2018
d7e1776
fix(floating-label): updated API for shake and float in component, an…
Feb 17, 2018
8a03462
Merge branch 'master' into chore/text-field/decouple-label
Feb 20, 2018
5973760
fix(floating-label): reorder scss import statements alphabetical
Feb 20, 2018
8385248
Merge branch 'chore/text-field/decouple-label' of github.com:material…
Feb 20, 2018
182b4b1
Merge branch 'master' into chore/text-field/decouple-label
Feb 21, 2018
ce05cda
fix(floating-label): rename from styleShake to shake and styleFloat t…
Feb 21, 2018
1a0aa6c
Merge branch 'master' into chore/text-field/decouple-label
Feb 21, 2018
7f69180
Merge branch 'master' into chore/text-field/decouple-label
Feb 21, 2018
f8ca6f1
fix(floating-label): moved animationend listeners to the init/destroy…
Feb 22, 2018
161e40a
fix(floating-label): fix floating label animation function
Feb 22, 2018
d6a5606
Merge branch 'master' into chore/text-field/decouple-label
Feb 22, 2018
eb3893f
fix(floating-label): fixed rtl for floating-label
Feb 22, 2018
da53da7
fix(floating-label): updated floating label comments
Feb 22, 2018
ead024d
Merge branch 'master' into chore/text-field/decouple-label
Feb 22, 2018
78f5b2d
fix(floating-label): remove empty parens from scss mixins
Feb 22, 2018
8a05219
Merge branch 'master' into chore/text-field/decouple-label
Feb 22, 2018
60467b6
WIP - decouple outline
Feb 23, 2018
466e7e6
fix(notched-outline): mainly working notched-outline
Feb 23, 2018
699da0a
Merge branch 'master' into chore/text-field/decouple-outline
Feb 23, 2018
ca134d9
fix(text-field): decouple outline work on dense
Feb 23, 2018
67c1ab8
fix(floating-label): fixed some typos and empty white space
Feb 23, 2018
d7e6962
Merge branch 'master' into chore/text-field/decouple-label
Feb 23, 2018
d76fedc
Merge branch 'chore/text-field/decouple-label' into chore/text-field/…
Feb 23, 2018
91ad0a9
fix(notched-outline): updated notched-outline readme and scss
Feb 27, 2018
edc898b
fix(text-field): fixed tests and moved notched-outline to its own pac…
Feb 27, 2018
5dbf686
fix(text-field): closure tests
Feb 27, 2018
6fdbafc
Merge branch 'master' into chore/text-field/decouple-label
Feb 27, 2018
30b59cb
Merge branch 'chore/text-field/decouple-label' into chore/text-field/…
Feb 27, 2018
2ae20d1
fix(notched-outline): renamed noched-outline--idle to notched-outline…
Feb 27, 2018
f03ca0e
fix(floating-label): fixed readme
Feb 28, 2018
957fa3c
fix(text-field): reverted sass mixin name change to ...-label-ink-color
Feb 28, 2018
7d3a17c
Merge branch 'master' into chore/text-field/decouple-label
Feb 28, 2018
5247b43
Merge branch 'master' into chore/text-field/decouple-label
Feb 28, 2018
cf75c3b
fix(text-field): renamed shake animation names and updated readme
Feb 28, 2018
fbce528
Merge branch 'chore/text-field/decouple-label' into chore/text-field/…
Feb 28, 2018
4237987
Merge branch 'master' into chore/text-field/decouple-label
Feb 28, 2018
f556712
Merge branch 'chore/text-field/decouple-label' into chore/text-field/…
Feb 28, 2018
f772800
fix(notched-outline): some readme and comment edits
Feb 28, 2018
a14f34a
fix(text-field): updated golden files to pass tests
Feb 28, 2018
0898056
chore(notched-outline): update readme
Mar 1, 2018
c46fa37
Merge branch 'master' into chore/text-field/decouple-outline
Mar 2, 2018
5d19c87
Merge branch 'master' into chore/text-field/decouple-outline
Mar 5, 2018
c2a9737
fix(notched-outline): updated readme and fixed text-field readme
Mar 6, 2018
3bfdcf2
Merge branch 'master' into chore/text-field/decouple-outline
Mar 6, 2018
4d4c4fe
Merge branch 'master' into chore/text-field/decouple-outline
Mar 6, 2018
b98ae09
fix(notched-outline): removed unused scss rules and renamed mixin for…
Mar 6, 2018
b7b9ce7
fix(text-field): changed mixin name
Mar 6, 2018
fc35362
fix(text-field): moved textfield outline mixins to appropriate section
Mar 6, 2018
2a30f0d
fix(package): remove duplicate package.json entries
Mar 7, 2018
9b539e0
Merge branch 'master' into chore/text-field/decouple-outline
Mar 9, 2018
adf5817
Merge branch 'master' into chore/text-field/decouple-outline
Mar 14, 2018
3f3ca89
fix(notched-outline): added 2 mixins to notched-outline and updated r…
Mar 14, 2018
f351e17
Merge branch 'master' into chore/text-field/decouple-outline
Mar 14, 2018
526a69f
test(notched-outline): added notchedOutline to deps to pass test
Mar 14, 2018
67bb0a5
Merge branch 'chore/text-field/decouple-outline' of github.com:materi…
Mar 15, 2018
e9141ea
fix(notched-outline): updated sass mixins to using 2 broder-radius mi…
Mar 15, 2018
0a6294c
Merge branch 'master' into chore/text-field/decouple-outline
Mar 15, 2018
9378b7c
fix(text-field): lint fix
Mar 15, 2018
8157968
Merge branch 'chore/text-field/decouple-outline' of github.com:materi…
Mar 15, 2018
142a142
Merge branch 'master' into chore/text-field/decouple-outline
Mar 15, 2018
0ec3a8f
fix(notched-outline): readme update explaining hwo to use mixins
Mar 15, 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
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/mdc-notched-outline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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.

### `MDCNotchedOutline`

Expand Down
13 changes: 13 additions & 0 deletions packages/mdc-notched-outline/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,16 @@
@include mdc-theme-prop(stroke, $color);
}
}

@mixin mdc-notched-outline-stroke-width($width) {
.mdc-notched-outline__path {
stroke-width: $width;
}
}

@mixin mdc-notched-outline-corner-radius($radius) {
&,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some comments here about why you have to do this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are looking at an older commit. This is now


@mixin mdc-notched-outline-corner-radius($radius) {
  border-radius: $radius;
}

@mixin mdc-notched-outline-idle-corner-radius($radius) {
  .mdc-notched-outline__idle {
    border-radius: $radius;
  }
}

~ .mdc-notched-outline__idle {
border-radius: $radius;
}
}
25 changes: 15 additions & 10 deletions packages/mdc-textfield/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
@import "icon/mixins";
@import "icon/variables";

@mixin mdc-text-field-outline-corner-radius($radius) {
border-radius: $radius;
}

@mixin mdc-text-field-box-corner-radius($radius) {
border-radius: $radius $radius 0 0;
}
Expand Down Expand Up @@ -207,9 +203,7 @@
}

@mixin mdc-text-field-outlined-focused_ {
.mdc-notched-outline__path {
stroke-width: 2px;
}
@include mdc-notched-outline-stroke-width(2px);
}

@mixin mdc-text-field-outlined-dense_ {
Expand Down Expand Up @@ -262,13 +256,17 @@
z-index: 2;
}

.mdc-notched-outline,
.mdc-notched-outline__idle {
@include mdc-text-field-outline-corner-radius($mdc-text-field-border-radius);
.mdc-notched-outline {
@include mdc-notched-outline-corner-radius($mdc-text-field-border-radius);
}
}

@mixin mdc-text-field-outline-color_($color) {
/** NOTE: outlined version of text-field wants the "idle" and
* "notched" outline to have the same color. This covers two cases:
* 1) text field renders with NO value in the "idle" state
* 2) text field renders with a value in the "notched" state
*/
@include mdc-notched-outline-idle-color($color);
@include mdc-notched-outline-color($color);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment that outlined version of text field wants the "idle" and "notched" version to have the same color. This covers two cases: 1) the "idle" state when a text field renders with no value 2) the "notched" state when a text field renders with an initial value

}
Expand All @@ -279,6 +277,13 @@
.mdc-text-field__icon:hover ~ {
@include mdc-notched-outline-idle-color($color);

/** tldr; this doesn't break BEM:
* We need to wrap this mixin with the .mdc-notched-outline
* selector, because of the sibling selector '~'. The notched
* outline html structure has .mdc-notched-outline
* and .mdc-notched-outline__idle as siblings, while
* .mdc-notched-outline__path is a child of .mdc-notched-outline
*/
.mdc-notched-outline {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a bunch of comments here around the ~ and sibling selector, and why thats hella complicated because mdc-notched-outline__path is a sub-element but mdc-notched-outline__idle is a sibling element.

And then file a GitHub issue to investigate making mdc-notched-outline__idle a sub-element of mdc-notched-outline.

@include mdc-notched-outline-color($color);
}
Expand Down
6 changes: 0 additions & 6 deletions packages/mdc-textfield/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/

/* eslint-disable no-unused-vars */
import MDCFloatingLabelFoundation from '@material/floating-label/foundation';
import MDCLineRippleFoundation from '@material/line-ripple/foundation';
import MDCNotchedOutlineFoundation from '@material/notched-outline/foundation';
import MDCTextFieldHelperTextFoundation from './helper-text/foundation';
import MDCTextFieldIconFoundation from './icon/foundation';

Expand All @@ -39,11 +36,8 @@ let NativeInputType;

/**
* @typedef {{
* lineRipple: (!MDCLineRippleFoundation|undefined),
* helperText: (!MDCTextFieldHelperTextFoundation|undefined),
* icon: (!MDCTextFieldIconFoundation|undefined),
* label: (!MDCFloatingLabelFoundation|undefined),
* outline: (!MDCNotchedOutlineFoundation|undefined)
* }}
*/
let FoundationMapType;
Expand Down