Commit 495d1574 authored by Martin Wortschack's avatar Martin Wortschack Committed by Ezekiel Kigbo

Add deprecation note for icon helper to frontend guidelines

parent f506606f
......@@ -13,6 +13,7 @@ module IconsHelper
# Right now this method simply delegates directly to `fa_icon` from the
# font-awesome-rails gem, but should we ever use a different icon pack in the
# future we won't have to change hundreds of method calls.
# @deprecated use sprite_icon to render a SVG icon
def icon(names, options = {})
if (options.keys & %w[aria-hidden aria-label data-hidden]).empty?
# Add 'aria-hidden' and 'data-hidden' if they are not set in options.
......
......@@ -22,7 +22,7 @@ Our goal is to replace one by one all inline SVG Icons (as those currently bloat
### Usage in HAML/Rails
To use a sprite Icon in HAML or Rails we use a specific helper function :
To use a sprite Icon in HAML or Rails we use a specific helper function:
```ruby
sprite_icon(icon_name, size: nil, css_class: '')
......@@ -48,6 +48,8 @@ sprite_icon(icon_name, size: nil, css_class: '')
</svg>
```
**Please note:** The `icon(icon_name, options: {})` helper function is deprecated and should not be used anymore.
### Usage in Vue
[GitLab UI](https://gitlab-org.gitlab.io/gitlab-ui/), our components library, provides a component to display sprite icons.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment