Skip to content

Commit

Permalink
Merge pull request #30 from storybookjs/update-icon-docs
Browse files Browse the repository at this point in the history
Update Icon comments for formatting in docs mode
  • Loading branch information
kylesuss authored Jun 26, 2019
2 parents d5c8d86 + daed1b5 commit 1261911
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const Path = styled.path`
/**
* An Icon is a piece of visual element, but we must ensure its accessibility while using it.
* It can have 2 purposes:
* - decorative only: for example, it illustrate a label next to it. We must ensure that it is ignored by screen readers, by setting `aria-hidden` attribute (ex: <Icon icon="check" aria-hidden />)
* - non-decorative: it means that it delivers an information. For example, an icon as only child inn a button. The meaning can be obvious visually, but it must have a proper text alternative via `aria-label` for screen readers. (ex: <Icon icon="print" aria-label="Print this document" />)
*
* - *decorative only*: for example, it illustrates a label next to it. We must ensure that it is ignored by screen readers, by setting `aria-hidden` attribute (ex: `<Icon icon="check" aria-hidden />`)
* - *non-decorative*: it means that it delivers information. For example, an icon as only child in a button. The meaning can be obvious visually, but it must have a proper text alternative via `aria-label` for screen readers. (ex: `<Icon icon="print" aria-label="Print this document" />`)
*/
export function Icon({ icon, block, ...props }) {
return (
Expand Down

0 comments on commit 1261911

Please sign in to comment.