User tests: Successful: Unsuccessful:
Pull Request for Issue #25239 .
Added a parameter to show / hide the back-to-top button in Cassiopeia
Install PR, run npm ci or compile the scss files from Cassiopeia
Go to template, under "advanced" a new switcher should appear
Currently the footer appears when a module has been published on position "footer". And the back-to-top only appears if the footer is visible. Since the footer is part of the grid, it is not easy to move the back-to-top outside the grid.
Now it is possible to decide to have a back-to-top or not. If yes, the footer will be rendered showing the button, independently if there is a module in the position footer.
It is also possible to show only modules (switch back-to-top off) or modules and back-to-top (switch on).
Example with module on footer and back-to-top button
Status | New | ⇒ | Pending |
Category | ⇒ | Language & Strings Front End Templates (site) NPM Change |
Should the sql be updated to include the default setting for this button?
Is it possible to add scroll-behaviour: smooth - it makes it much nicer than a big jump
See https://css-tricks.com/almanac/properties/s/scroll-behavior/
Yes, I was thinking about smooth scrolling, but added in this way:
https://moderncss.dev/pure-css-smooth-scroll-back-to-top/#add-smooth-scrolling
Its the same isnt it?
Labels |
Added:
?
NPM Resource Changed
?
|
with "prefers-reduced-motion: no-preference" we will have the smooth scrolling only if the user has no reduced-motion preferences set
missed that bit. good spot
Should the sql be updated to include the default setting for this button?
That is not necessary because the default value is set to 0 directly on the field
@drmenzelit I've applied the PR on current 4.0-dev and run npm ci
and even cleared browser cache and so on, but here it looks strange.
I have a custom html module with some text on footer position, and the back to top button gets the same height as the module has.
The button works well, and I could live with that, but maybe you can fix it?
Should the sql be updated to include the default setting for this button?
That is not necessary because the default value is set to 0 directly on the field
That is ok because the default value is 0. If it was e.g. 1, one would have to save the template style settings for the first time before calling $this->params->get('backTop')
would return 1.
So maybe we should add it at least to the installation SQL for new installations?
I have a custom html module with some text on footer position, and the back to top button gets the same height as the module has.
The button works well, and I could live with that, but maybe you can fix it?
I will look at this :-)
@richard67 can you please look again? I added height and position to the button.
@drmenzelit SCSS code style issue, see report from drone here: https://ci.joomla.org/joomla/joomla-cms/34889/1/24 . It's about the order of properties:
templates/cassiopeia/scss/blocks/_footer.scss
10:5 Expected "height" to come before "border-radius" order/properties-order
11:5 Expected "align-self" to come before "height" order/properties-order
The "xx:yy" at the beginning of each message is "line number":"position in line".
No it should be ok, I found out how to use stylelint ;-)
I have tested this item
I see the following
@media screen and (prefers-reduced-motion: no-preference) {
html,
body {
scroll-behavior: smooth;
}
}
Now there is smooth scrolling when the browser setting prefers-reduced-motion
=== no-preference
Besides no-preference there is the option reduced
. https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
So... when reduced
is set the scroll-behavior
will not be set.
What if a new option is introduced?
Wouldn't it be better to turn things around?
:root {
scroll-behavior: smooth;
// No smooth scroll for people who prefer not to
@media screen and (prefers-reduced-motion: reduce) {
scroll-behavior: auto;
}
}
I have tested this item
@drmenzelit I would recommend you remove any right padding so it lines up with the container and put it in its own space outside of the footer if.
@drmenzelit I would recommend you remove any right padding so it lines up with the container and put it in its own space outside of the footer if.
Styling will be taken care of in another PR.
I have tested this item
This type of element really should be set o not be printed
@media print { .back-top{ display: none; } }
@infograf768 The template structure with colours and margins / paddings is work in progress.
I have tested this item
print styling will be taken care of in redesign of Cassiopeia. George mentioned https://twitter.com/dgrammatiko/status/1298231873425092609?s=21 which is interesting
i really would like to close this pointing to a real pr , can you share a link ?
i really would like to close this pointing to a real pr , can you share a link ?
I hope this is good enough
https://github.com/joomla/cassiopeia/issues
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-08-26 08:50:51 |
Closed_By | ⇒ | infograf768 | |
Labels |
Added:
?
|
@Scrabble96 You know that you have to switch it on in Cassiopeia's template style settings in the "Advanced" tab?
@Scrabble96 You know that you have to switch it on in Cassiopeia's template style settings in the "Advanced" tab?
I do now! It wasn't there in Protostar, so it's going to have to be made obvious to new users of Cassiopeia that it is switched on or off in the Styles Advanced tab.
@Scrabble96 The description of this PR here explains that clearly. I assumed when you are commenting this PR then yopu have read its description, too. And sure, later it has to be described somewhere in documentations.
@Scrabble96 The description of this PR here explains that clearly. I assumed when you are commenting this PR then yopu have read its description, too. And sure, later it has to be described somewhere in documentations.
Sorry. Long day. I'll delete my comment.
Sorry if I sounded too harsh. Was a long day for me, too.
@drmenzelit Does it fix issue #25239 ?
Update: Yes, it does. Clarified on Glip.