Skip to content

Commit

Permalink
Merge pull request #499 from primer/js-edits
Browse files Browse the repository at this point in the history
Small edits in JS page
  • Loading branch information
ashygee authored Dec 7, 2020
2 parents 4b25434 + 4ec4065 commit ecf9e3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/content/packages/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ octicons.x.heights

### `octicons[name].heights[height].width`

Returns the icon's true width, based on the svg view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon._
Returns the icon's true width, based on the SVG view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon._

### `octicons[name].heights[height].path`

Expand Down Expand Up @@ -134,7 +134,7 @@ octicons.x.toSVG()
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-hidden="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
```

The `.toSVG()` method accepts an optional `options` object. This is used to add CSS classnames, a11y options, and sizing.
The `.toSVG()` method accepts an optional `options` object. This is used to add CSS classnames, acessibility options, and sizing.

#### class

Expand All @@ -154,9 +154,9 @@ octicons.x.toSVG({ "aria-label": "Close the window" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-label="Close the window" role="img"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
```

#### width & height
#### width and height

Size the SVG icon larger using `width` & `height` independently or together. `.toSVG()` will automatically choose the best SVG to render based on the width or height passed in.
Size the SVG icon larger using `width` and `height` independently or together. `.toSVG()` will automatically choose the best SVG to render based on the width or height passed in.

```js
octicons.x.toSVG({ "width": 45 })
Expand Down

0 comments on commit ecf9e3c

Please sign in to comment.