Last active
October 1, 2020 20:35
-
-
Save wesruv/d9e77adc4ce81a534aa007ba0344a882 to your computer and use it in GitHub Desktop.
Adding PFE to Management
This file contains 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
// Kyle says you don't need to what was here. |
This file contains 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 is the code that will add pfe-icon, must be run after the above. | |
// Optimally, it's only added on pages that have a pfe-icon, but it's an extra ~5kb of JS | |
// include pfe-icon | |
chrometwo_require(["pfe", "wc"], function(pfe){ | |
pfe.include("pfe-icon"); | |
}); |
This file contains 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
<!-- HTML for the icon --> | |
<pfe-icon icon="rh-collaboration"></pfe-icon> | |
<!-- Optionally add size, you can edit them in dev tools to see it live update --> | |
<pfe-icon icon="rh-collaboration" pfe-size="2x"></pfe-icon> | |
<!-- | |
Size and other attributes are documented here: https://github.com/patternfly/patternfly-elements/tree/master/elements/pfe-icon | |
If there are other style changes to this or other elements, it can be done with CSS Variables (aka CSS Custom Properties) I can help show you that too, it's pretty straightforward once you see it done. | |
--> |
This file contains 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
<!-- If you see or are worried about FOUC (Flash of unstyled content) from PFE --> | |
<!-- Add the unresolved property to the body tag e.g. --> | |
<body unresolved> | |
<!-- And in the head add this stylesheet --> | |
<link media="all" rel="stylesheet" type="text/css" href="https://access.redhat.com/webassets/avalon/j/public_modules/node_modules/@patternfly/pfelement/dist/pfelement.min.css" /> | |
<!-- That stylesheet subtly hides the FOUC by fading in the page after the web components have rendered --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment