Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PLAY-1265] Add 'svg-inline--fa' class to our icons #3256

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions playbook/app/pb_kits/playbook/pb_icon/_icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const Icon = (props: IconProps) => {
flipMap[flip],
(!iconElement && !customIcon) ? 'pb_icon_kit' : '',
(iconElement || customIcon) ? 'pb_custom_icon' : fontStyle,
iconElement ? 'svg-inline--fa' : '',
faClasses,
globalProps(props),
className
Expand Down
6 changes: 3 additions & 3 deletions playbook/app/pb_kits/playbook/pb_icon/icon.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# rubocop:disable Style/StringConcatenation, Style/HashLikeCase
# rubocop:disable Style/HashLikeCase

require "open-uri"

Expand Down Expand Up @@ -89,7 +89,7 @@ def asset_path
def render_svg
doc = Nokogiri::XML(URI.open(asset_path || icon || custom_icon)) # rubocop:disable Security/Open
svg = doc.at_css "svg"
svg["class"] = "pb_custom_icon " + object.custom_icon_classname
svg["class"] = %w[pb_custom_icon svg-inline--fa].concat([object.custom_icon_classname]).join(" ")
svg["id"] = object.id
svg["data"] = object.data
svg["aria"] = object.aria
Expand Down Expand Up @@ -167,4 +167,4 @@ def spin_class
end
end

# rubocop:enable Style/StringConcatenation, Style/HashLikeCase
# rubocop:enable Style/HashLikeCase
Loading