Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
495d1574
Commit
495d1574
authored
Dec 02, 2020
by
Martin Wortschack
Committed by
Ezekiel Kigbo
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add deprecation note for icon helper to frontend guidelines
parent
f506606f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+1
-0
doc/development/fe_guide/icons.md
doc/development/fe_guide/icons.md
+3
-1
No files found.
app/helpers/icons_helper.rb
View file @
495d1574
...
...
@@ -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.
...
...
doc/development/fe_guide/icons.md
View file @
495d1574
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment