Skip to content

Commit

Permalink
chore(docs): Add inline-mode instructions to docs. (#331)
Browse files Browse the repository at this point in the history
Fixes #315
  • Loading branch information
mollerse authored Nov 12, 2024
1 parent eda3aa0 commit 88970bf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,13 @@ We host the following scripts for use in the browser on our cdn
For stability, please link to the appropriate major version

```html
<script
async
src="https://static.nrk.no/core-icons/major/14/core-icons-iife.js"
></script>
<script async src="https://static.nrk.no/core-icons/major/14/core-icons-iife.js"></script>
```

Linking to `/latest/` is recommended only for prototyping.

```html
<script
async
src="https://static.nrk.no/core-icons/latest/core-icons-iife.js"
></script>
<script async src="https://static.nrk.no/core-icons/latest/core-icons-iife.js"></script>
```

### Using Android
Expand Down Expand Up @@ -265,7 +259,6 @@ fun NrkIcon.asDrawable(context: Context): Drawable? {
}
```


## Scaling

Since logos do not have consistent dimensions, `@nrk/core-icons` provides scaling based on `font-size`.
Expand All @@ -278,6 +271,11 @@ Scale the icons/logos by using font sizes divisible with `16` for sharpest rende

Note: correct width/height in `em` for each icon is automatically provided by `@nrk/core-icons`. For browser/iife scripts, you can get the correct HTML markup from the `Copy HTML` button in the hover-menu for each [icon](#browse-icons) or [logo](#browse-logos) in their respective preview-sections above.

## Icons in text

To use core-icons mixed in with text in `inline` mode, ensure that the icon is sized such that it's dimensions are equal to the `line-height`. You can then use `vertical-align` (`top`/`bottom`) works nicely to align the icon with the text.
If there are any visual adjustments needed for the icon to be visually aligned the proper way, please file an [issue](https://github.com/nrkno/core-icons/issues/new) with the icon-name and a screenshot of the issue.

## Accessibility

Modern versions of assistive technologies will announce SVG content, but there is still a lot of differences between browsers. To avoid confusion, use the following conventions:
Expand Down

0 comments on commit 88970bf

Please sign in to comment.