Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 10, 2018
1 parent cb21d40 commit cee7cb2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/src/pages/style/icons/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ We add the `aria-hidden=true` and `role="img"` attributes so that your icons are

### Semantic SVG Icons

If your icon has semantic meaning, all you need to do is throw a `titleAccess="meaning"` property. It should be enough but you can always use the `moreChildren` property to add a `desc` description element.
If your icon has semantic meaning, all you need to do is throw in a `titleAccess="meaning"` property.

In the case of focusable interactive elements, like when used with a icon button, you can use the `aria-label` property:
In the case of focusable interactive elements, like when used with an icon button, you can use the `aria-label` property:

```jsx
import IconButton from '@material-ui/core/IconButton';
Expand All @@ -156,7 +156,7 @@ We add the `aria-hidden=true` attribute so that your icons are properly accessib

### Semantic Font Icons

If your icons have semantic meaning, you need to provide a text alternative only visible assisitive technologies.
If your icons have semantic meaning, you need to provide a text alternative only visible to assisitive technologies.

```css
.sr-only {
Expand Down
1 change: 0 additions & 1 deletion packages/material-ui/src/SvgIcon/SvgIcon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export interface SvgIconProps
color?: PropTypes.Color | 'action' | 'disabled' | 'error';
component?: React.ReactType<SvgIconProps>;
fontSize?: 'inherit' | 'default';
moreChildren?: React.ReactNode;
nativeColor?: string;
titleAccess?: string;
viewBox?: string;
Expand Down
7 changes: 0 additions & 7 deletions packages/material-ui/src/SvgIcon/SvgIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function SvgIcon(props) {
color,
component: Component,
fontSize,
moreChildren,
nativeColor,
titleAccess,
viewBox,
Expand Down Expand Up @@ -80,7 +79,6 @@ function SvgIcon(props) {
>
{children}
{titleAccess ? <title>{titleAccess}</title> : null}
{moreChildren}
</Component>
);
}
Expand Down Expand Up @@ -113,11 +111,6 @@ SvgIcon.propTypes = {
* The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
*/
fontSize: PropTypes.oneOf(['inherit', 'default']),
/**
* Provide more children the svg icon.
* It can be used to inject a `desc` element for accessibility.
*/
moreChildren: PropTypes.node,
/**
* Applies a color attribute to the SVG element.
*/
Expand Down
1 change: 0 additions & 1 deletion pages/api/svg-icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import SvgIcon from '@material-ui/core/SvgIcon';
| <span class="prop-name">color</span> | <span class="prop-type">enum:&nbsp;'inherit', 'primary', 'secondary', 'action', 'error', 'disabled'<br> | <span class="prop-default">'inherit'</span> | The color of the component. It supports those theme colors that make sense for this component. You can use the `nativeColor` property to apply a color attribute to the SVG element. |
| <span class="prop-name">component</span> | <span class="prop-type">union:&nbsp;string&nbsp;&#124;<br>&nbsp;func&nbsp;&#124;<br>&nbsp;object<br> | <span class="prop-default">'svg'</span> | The component used for the root node. Either a string to use a DOM element or a component. |
| <span class="prop-name">fontSize</span> | <span class="prop-type">enum:&nbsp;'inherit'&nbsp;&#124;<br>&nbsp;'default'<br> | <span class="prop-default">'default'</span> | The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size. |
| <span class="prop-name">moreChildren</span> | <span class="prop-type">node |   | Provide more children the svg icon. It can be used to inject a `desc` element for accessibility. |
| <span class="prop-name">nativeColor</span> | <span class="prop-type">string |   | Applies a color attribute to the SVG element. |
| <span class="prop-name">titleAccess</span> | <span class="prop-type">string |   | Provides a human-readable title for the element that contains it. https://www.w3.org/TR/SVG-access/#Equivalent |
| <span class="prop-name">viewBox</span> | <span class="prop-type">string | <span class="prop-default">'0 0 24 24'</span> | Allows you to redefine what the coordinates without units mean inside an SVG element. For example, if the SVG element is 500 (width) by 200 (height), and you pass viewBox="0 0 50 20", this means that the coordinates inside the SVG will go from the top left corner (0,0) to bottom right (50,20) and each unit will be worth 10px. |
Expand Down

0 comments on commit cee7cb2

Please sign in to comment.