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
Fixes Header on small screen setup #990
Conversation
@josemigallas It would be nice to have before/after screenshot ;) |
@@ -282,8 +282,8 @@ button:-moz-focusring, | |||
-ms-grid-row-span: 1; | |||
grid-row: 2 / 3; | |||
min-width: 0; | |||
padding-left: 0; | |||
background-color: transparent; | |||
padding-left: 0 !important; // Need to override styles introduced by PF React |
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.
Or loading this after PF React won't do?
Or using more precise css rules?
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.
@josemigallas This file is called _patternfly_ie11.scss
. I'd expect is loaded only when using IE11 but is imported in app/assets/stylesheets/provider/_theme.scss
. We shouldn't load this file if unnecessary.
This style is only needed in IE11?
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.
@hallelujah It's more complex than that. The problem is using PF react and rails. Rails styles are load first in a big bundle, after that React loads its own styles and put them inline. This means there is no way to load this style after PF react (that would be the ideal solution).
It would be possible to add these styles by React, in a different styles.scss file but I think leaving it here in _patternfly_ie11.scss
makes it more maintainable. In the end the file itself is a hacky workaround and it will be removed when we drop IE11 support.
Adding a more precise rule could be possible (I guess) but I think this way the intent is clearer and again, it is a hack already.
@damianpm It is not. These contains all PF4 styles necessary for the Page, Header and Vertical Navigation, that are also compatible with IE11. This was discussed and introduced in #859. And it's the official Patternfly way according to this wiki.
It could have been named patternfly_ie11_compatible.scss
to avoid confusion.
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.
OK, then we should rename it.
What about importing this file from webpack, after DOMContentLoaded, have you tried?
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.
Styles will be broken if JS is disabled then. This file has to be there..
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.
Well if js is disabled everything will be broken. But is not big deal, I can live with this file where it is
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.
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.
There is no context selector :(
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.
Obviously a big amount of features won't work without JS but that doesn't mean everything is broken. Lacking functionality should be implemented accordingly to progressive enhancement, if they are really necessary. Having JS disabled is an edge case but if we are able to minimize the damage...
What this PR does / why we need it:
After introducing PF4 React in vert nav, the header is showing some weird styles due to Patternfly variables.
In order to fix this, it is required to use
!important
in our_patternfly_ie11.scss
.Before:
After:
Which issue(s) this PR fixes
THREESCALE-3013: Header changes color when on small screen setup
Verification steps