Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow custom style in dashicon/svg #12403

Closed
wants to merge 1 commit into from
Closed

Conversation

koke
Copy link
Contributor

@koke koke commented Nov 28, 2018

This extends the previous solution in #11827 by allowing a style prop to be passed to a Dashicon.
The previous solution required Svg being aware of other parts of the app and including hardcoded colors in its CSS.

This change lets you override those and specify the style directly. I haven't changed the existing toolbar icons since IconButton will pass the extra props to Button, not Dashicon

To be tested with wordpress-mobile/gutenberg-mobile#286 for the inline toolbar buttons

@koke koke added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Nov 28, 2018
@koke koke requested a review from marecar3 November 28, 2018 22:52
koke added a commit to wordpress-mobile/gutenberg-mobile that referenced this pull request Nov 29, 2018
pinarol pushed a commit to wordpress-mobile/gutenberg-mobile that referenced this pull request Nov 30, 2018
* Make the inline toolbar nicer

This replaces the icons with dashicons, tweaks the layout to be closer to the
designs, and removes the unused settings button.

* Only show arrow buttons when you can move the block

* Add borders to block when focused

* Updated colors for inline toolbar and block holder

This imports a color palette taken from calypso instead of the Gutenberg one

* Remove unused imports

* Revert gutenberg

We're skipping WordPress/gutenberg#12403 for now

* Replace InlineToolbarButton as ToolbarButton

* Update subrepo ref to point to rnmobile/dashicon-styles

* Update react-native-aztec to point to master

* Fixed inline toolbar buttons, used to ToolbarButton interface from components

* Update gutenberg subrepo ref to point to master

* Fix lint issues
@@ -22,7 +22,8 @@ export default class Dashicon extends Component {
this.props.icon !== nextProps.icon ||
this.props.size !== nextProps.size ||
this.props.className !== nextProps.className ||
this.props.ariaPressed !== nextProps.ariaPressed
this.props.ariaPressed !== nextProps.ariaPressed ||
this.props.style !== nextProps.style
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated by the Dashicons project and copied here verbatim. The files should not be manually revised without an upstream patch.

@koke
Copy link
Contributor Author

koke commented Dec 4, 2018

Closing, since we found a way around it that doesn't require to modify dashicons.

@koke koke closed this Dec 4, 2018
@koke koke deleted the rnmobile/dashicon-styles branch December 4, 2018 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants