-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Cassiopea: allow header to be sticky if desired #27579
Conversation
templates/cassiopeia/index.php
Outdated
$stickyHeader = $this->params->get('stickyHeader') ? 'sticky-header' : ''; | ||
|
||
// Stick the header | ||
if ($stickyHeader === 'sticky-header') |
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.
Please move this styling to the SCSS file.
You can then remove -webkit-sticky
too.
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.
As I wrote, I tried that in the grid scss by adding .sticky-header as a child of .container-header but it did not work.
Maybe it could be added by itself. Will test again.
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.
also -webkit-sticky is essential for safari.
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 maybe you need in another scss? global?
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.
also -webkit-sticky is essential for safari.
The autoprefixer
package hooks in when SCSS compiles to CSS and adds in vendor related things (i.e. the -webkit-sticky
property) based on the browsers that it's told to support. So you don't need to manually add all the browser related stuff to the SCSS files, the build step takes care of that for you.
@@ -93,7 +111,7 @@ | |||
. $hasClass; | |||
echo ($this->direction == 'rtl' ? ' rtl' : ''); | |||
?>"> | |||
<div class="grid-child container-header full-width"> | |||
<div class="grid-child container-header full-width <?php echo $stickyHeader; ?>"> |
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.
Add the class to the <header>
, not the page container
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.
it does not work in that case. In fact it breaks the display.
Or maybe I do not understand what you mean?
if in header class="header", I stand with my statement.
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.
I'll look at this properly tomorrow
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.
Moved css, see below.
We 'may' move it to <header
when the curve will be gone. See: #27566
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.
Move to <header>
?
d436acf
to
48dd750
Compare
@jwaisner |
@C-Lodder npm needed. |
Folks, if #27566 is tested and merged, this PR will be modified. |
I have tested this item ✅ successfully on 37bdd98 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
@C-Lodder |
OK. It would work indeed, but no use. I will delete that scss. See below.
I had tested that. But after also adding it works fine in all browsers tested. |
I have tested this item ✅ successfully on f5c1f72 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
@jwaisner |
Do you want to add this parameter to joomla.sql?
|
I haven't tested this but would this not also stick the banner position? Maybe an issue on small devices if anything large in there. |
yes and the search postion |
I have tested this item ✅ successfully on 9b669f6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
Not sure it is absolutely necessary as the absence of the parameter = No |
Yep, it does. That's why we have a parameter to choose sticky or not, default being No which I would recommend in case of large banner usage..
Nope. Search is in the toggler as well as the menu position. |
RTC. It is now the decision of maintainers to get this feature in or not. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
A fair point but personally I would just stick the navigation/logo. Also may be worth wrapping it in a media query so it only applies to desktops. |
The only way I found was to separate totally the banner from the
We indeed could do that. In any case, if the banner is huge, we would have the same issue in mobile view. Is it worth? |
Try this applied to the
|
Would rather be
and indeed, for smaller screens, the header would not stick. @wilsonge @HLeithner |
Personally I find sticky headers on mobiles annoying as it reduces the screen size available for the text. So I'd kinda be ok with it tablet and up 🤷♂ but it's just a personal opinion - nothing more |
OK, will do in order to get rid of that and concentrate on other matters |
5750193
to
236c7d3
Compare
Now unstuck in mobile view. Needs npm |
Removed RTC because a new round of testing is requested from the author of the PR This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
I have tested this item ✅ successfully on d6ae643 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
I have tested this item ✅ successfully on d6ae643 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27579. |
Pull Request for Issue #27549
Summary of Changes
Adding css and parameter to make the Header sticky if desired.
Default to No.
FI: I had to add the css in index.php as adding it in grid scss did not work.
Testing Instructions
Patch. NPM needed.
Edit Cassiopea template style, Advanced tab.
Set
Sticky Header
toYes
Display frontend and scroll.
Expected result
Note
Works here on Chrome, Firefox, Safari, Opera. Did not test other browsers.
I have no pre-conceived idea about adding this parameter or not, but we now have the choice to add this to Cassiopea if maintainers desire.