-
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
chore(notched-outline): separate outline from text-field #2326
Changes from 69 commits
a9d6c3c
9b750cd
4b01134
5a4500f
324a638
51f16f6
af02b19
6f9abdf
028c00d
024ff39
2f72c61
c2f6b95
f452125
f00ef39
4a9846c
1f2cf62
ab8b035
040f739
d3871a3
252ffc4
43bd881
9b627e2
808b6ff
bed6857
2c1c55e
d7e1776
8a03462
5973760
8385248
182b4b1
ce05cda
1a0aa6c
7f69180
f8ca6f1
161e40a
d6a5606
eb3893f
da53da7
ead024d
78f5b2d
8a05219
60467b6
466e7e6
699da0a
ca134d9
67c1ab8
d7e6962
d76fedc
91ad0a9
edc898b
5dbf686
6fdbafc
30b59cb
2ae20d1
f03ca0e
957fa3c
7d3a17c
5247b43
cf75c3b
fbce528
4237987
f556712
f772800
a14f34a
0898056
c46fa37
5d19c87
c2a9737
3bfdcf2
4d4c4fe
b98ae09
b7b9ce7
fc35362
2a30f0d
9b539e0
adf5817
3f3ca89
f351e17
526a69f
67bb0a5
e9141ea
0a6294c
9378b7c
8157968
142a142
0ec3a8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!--docs: | ||
title: "Notched Outline" | ||
layout: detail | ||
section: components | ||
excerpt: "The notched outline is a border around either a text field or select element" | ||
iconId: text_field | ||
path: /catalog/input-controls/notched-outline | ||
--> | ||
|
||
# Notched Outline | ||
|
||
The outline is a border around all sides of either a text field or select component. This is used for the Outlined variant of either a Text Field or Select. | ||
|
||
## Design & API Documentation | ||
|
||
<ul class="icon-list"> | ||
<li class="icon-list-item icon-list-item--spec"> | ||
<a href="https://material.io/guidelines/components/text-fields.html#text-fields-field-variations">Material Design guidelines: Text Field Variations</a> | ||
</li> | ||
</ul> | ||
|
||
## Usage | ||
|
||
### HTML Structure | ||
|
||
```html | ||
<div class="mdc-notched-outline"> | ||
<svg> | ||
<path class="mdc-notched-outline__path"/> | ||
</svg> | ||
</div> | ||
<div class="mdc-notched-outline__idle"></div> | ||
``` | ||
|
||
> For usage within a text field [see](../mdc-textfield/README.md#outlined/). | ||
|
||
### CSS Classes | ||
|
||
CSS Class | Description | ||
--- | --- | ||
`mdc-notched-outline` | Mandatory. Container for the SVG of the notched outline path. | ||
`mdc-notched-outline__path` | Mandatory. The path of the SVG of the notched outline. | ||
`mdc-notched-outline__idle` | Mandatory. The full outline when the notch is hidden. | ||
|
||
### Sass Mixins | ||
|
||
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. | ||
|
||
### `MDCNotchedOutline` | ||
|
||
Method Signature | Description | ||
--- | --- | ||
`updateSvgPath(notchWidth: number, isRtl: boolean) => void` | Updates the SVG of the outline element with a notch calculated based off of the notchWidth. The notch will appear left justified, unless isRtl is true. | ||
|
||
### `MDCNotchedOutlineAdapter` | ||
|
||
Method Signature | Description | ||
--- | --- | ||
`getWidth() => number` | Returns the width of the outline element. | ||
`getHeight() => number` | Returns the height of the outline element. | ||
`setOutlinePathAttr(value: string) => void` | Sets the "d" attribute of the outline element's SVG path. | ||
`getIdleOutlineStyleValue(propertyName: string) => string` | Returns the idle outline element's computed style value of a given css `propertyName`. | ||
|
||
### `MDCNotchedOutlineFoundation` | ||
|
||
Method Signature | Description | ||
--- | --- | ||
`updateSvgPath(notchWidth: number, isRtl: boolean) => void` | Updates the SVG path of the focus outline element based on the given notchWidth and the RTL context. | ||
|
||
|
||
[//]: <> (TODO(mattgoo): add how to hide/show notch in outline) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Copyright 2018 Google Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
@import "@material/theme/mixins"; | ||
|
||
@mixin mdc-notched-outline-idle-color($color) { | ||
.mdc-notched-outline__idle { | ||
@include mdc-theme-prop(border-color, $color); | ||
} | ||
} | ||
|
||
@mixin mdc-notched-outline-color($color) { | ||
.mdc-notched-outline__path { | ||
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. Add 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. Do you think that the 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. Sounds good to me |
||
@include mdc-theme-prop(stroke, $color); | ||
} | ||
} |
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.
Missing the word "here"?
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.
you mean it should be
text field see [here]
?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.
Yeah, otherwise it would say "For usage within a text field see."