Skip to content

Conversation

@jschuler
Copy link
Collaborator

@jschuler jschuler commented Jun 6, 2019

Use shadow-dom for the examples so they do not accidentally receive css overrides from the website styling

@jschuler jschuler requested review from dgutride and redallen June 6, 2019 14:11

const packageJson = require('../package.json');
// get the specific version of patternfly as used by the react examples
const pfVersion = packageJson.dependencies['@patternfly/src-patternfly-next'].split('#v')[1];
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm about to break this with submodules. I don't mind fixing it, just tell me what exactly it's doing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually i think i'll take another look at this. basically i need to load one set of patternfly css for the core examples, and one set for the react examples, since they may not be in sync

Copy link
Contributor

Choose a reason for hiding this comment

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

We fixed this making the version of @patternfly/patternfly in _repos/react-core exactly the version in _repos/core.

// patternfly-icons assumes classes are nested under html tag, doesn't work in shadow dom so strip them out
const strippedHtmlIconsStyles = patternFlyIcons.replace(/html\s/g, '');
return (
<ShadowDOM>
Copy link
Contributor

Choose a reason for hiding this comment

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

Much simpler than I anticipated!

@redallen redallen merged commit 61735f6 into master Jun 13, 2019
@ddonahue007 ddonahue007 deleted the use-shadow-dom branch January 22, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants