This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
fix(docs): fix conflict Fela and FontAwesome #951
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7628244
fix(docs): fix conflict Fela and FontAwesome
layershifter 08c4a06
add changelog entry
layershifter 0cd373c
fix danger!
layershifter 7a15c0b
use default too
layershifter c9a189f
Merge branches 'docs/fela-fa' and 'master' of https://github.com/star…
layershifter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,13 @@ import rtl from 'fela-plugin-rtl' | |
|
|
||
| import { Renderer } from '../themes/types' | ||
|
|
||
| // Blacklist contains a list of classNames that are used by FontAwesome | ||
| // https://fontawesome.com/how-to-use/on-the-web/referencing-icons/basic-use | ||
| const blacklistedClassNames = ['fa', 'fas', 'far', 'fal', 'fab'] | ||
|
|
||
| const filterClassName = (className: string): boolean => | ||
| className.indexOf('ad') === -1 && blacklistedClassNames.indexOf(className) === -1 | ||
|
|
||
| const createRendererConfig = (options: any = {}) => ({ | ||
| devMode: process.env.NODE_ENV !== 'production', | ||
| plugins: [ | ||
|
|
@@ -24,6 +31,7 @@ const createRendererConfig = (options: any = {}) => ({ | |
| felaPluginFallbackValue(), | ||
| ...(options.isRtl ? [rtl()] : []), | ||
| ], | ||
| filterClassName, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just as I see it here: you can now use the rtl plugin with a theme.direction property to trigger rtl transformation (check the plugin docs) that way you dont have to conditionally add the plugin
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, seen these changes. Going to visit this place in a separate PR 👍 |
||
| enhancers: [], | ||
| ...(options.isRtl ? { selectorPrefix: 'rtl_' } : {}), | ||
| ...(options.rendererId ? { rendererId: options.rendererId } : {}), | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit concerned about these as they can change at any time in fontawesome and we have no control over that..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree - especially given that each theme might load CSS libraries with different set of class names that should be blacklisted. Would expect that this
blacklistedinformation will be defined by theme, not (only) general Stardust logic - and, thus, would be extendable