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

[RN mobile] fix className style in SVG primitive #10556

Merged
merged 6 commits into from
Oct 12, 2018

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Oct 12, 2018

Description

As explained in #9294 (comment), commits 2d47451 and b678c6d introduced a change that makes sure to convert a string className value to a style object for ReactNative to work properly without needing to strip the className altogether (and thus losing any intended modifiers, as is currently being done in master).
These commits were removed somehow after introducing #9685 and applying the "older" #9294 after it, so this PR only brings this change back as originally intended.

How has this been tested?

To test how this works:

  1. make sure to add the following sample/test code
.dashicons-editor-bold {
	transform: rotate(20deg);
}

to packages/components/src/dashicon/style.scss

  1. Run the mobile Gutenberg app

This way the styles get passed to the svg component, this is how the bold icon gets rendered:

screen shot 2018-09-06 at 13 21 46

Verify the B icon is slightly (20 degrees) leaning to the right as seen in the screenshot

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@mzorz mzorz added [Type] Bug An existing feature does not function as intended Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Oct 12, 2018
@mzorz mzorz requested review from gziolo and hypest October 12, 2018 14:20
Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

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

LGTM!

I verified that the "B" is leaning 20º the the right! ;)

@mzorz mzorz merged commit b1c05b3 into master Oct 12, 2018
@mzorz mzorz deleted the rnmobile/fix-classname-style-svg branch October 12, 2018 17:02
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) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants