? NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar drmenzelit
drmenzelit
21 Aug 2020

Pull Request for Issue #25239 .

Summary of Changes

Added a parameter to show / hide the back-to-top button in Cassiopeia

Testing Instructions

Install PR, run npm ci or compile the scss files from Cassiopeia
Go to template, under "advanced" a new switcher should appear
Screenshot_2020-08-21 Templates Edit Style - Joomla Cassiopeia - Administration

Actual result BEFORE applying this Pull Request

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.

Expected result AFTER applying this Pull Request

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

Screenshot_2020-08-21 Home

Documentation Changes Required

avatar drmenzelit drmenzelit - open - 21 Aug 2020
avatar drmenzelit drmenzelit - change - 21 Aug 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Aug 2020
Category Language & Strings Front End Templates (site) NPM Change
avatar richard67
richard67 - comment - 21 Aug 2020

@drmenzelit Does it fix issue #25239 ?

Update: Yes, it does. Clarified on Glip.

avatar brianteeman
brianteeman - comment - 21 Aug 2020

Should the sql be updated to include the default setting for this button?

avatar brianteeman
brianteeman - comment - 21 Aug 2020

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/

avatar drmenzelit
drmenzelit - comment - 21 Aug 2020

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

avatar brianteeman
brianteeman - comment - 21 Aug 2020

Its the same isnt it?

avatar drmenzelit drmenzelit - change - 21 Aug 2020
Labels Added: ? NPM Resource Changed ?
avatar drmenzelit
drmenzelit - comment - 21 Aug 2020

with "prefers-reduced-motion: no-preference" we will have the smooth scrolling only if the user has no reduced-motion preferences set

avatar brianteeman
brianteeman - comment - 21 Aug 2020

missed that bit. good spot

avatar drmenzelit
drmenzelit - comment - 21 Aug 2020

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

avatar richard67
richard67 - comment - 21 Aug 2020

@drmenzelit I've applied the PR on current 4.0-dev and run npm ciand 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.

backtotop-1

The button works well, and I could live with that, but maybe you can fix it?

avatar richard67
richard67 - comment - 21 Aug 2020

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?

avatar drmenzelit
drmenzelit - comment - 22 Aug 2020

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 :-)

avatar drmenzelit
drmenzelit - comment - 22 Aug 2020

@richard67 can you please look again? I added height and position to the button.

avatar richard67
richard67 - comment - 22 Aug 2020

@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".

avatar drmenzelit
drmenzelit - comment - 22 Aug 2020

No it should be ok, I found out how to use stylelint ;-)

avatar richard67 richard67 - test_item - 22 Aug 2020 - Tested successfully
avatar richard67
richard67 - comment - 22 Aug 2020

I have tested this item successfully on 22b39bb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar hans2103
hans2103 - comment - 22 Aug 2020

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;
  }
}
avatar hans2103 hans2103 - test_item - 22 Aug 2020 - Tested successfully
avatar hans2103
hans2103 - comment - 22 Aug 2020

I have tested this item successfully on ed6dd47


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar N6REJ
N6REJ - comment - 22 Aug 2020

@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.

avatar hans2103
hans2103 - comment - 22 Aug 2020

@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.

avatar chmst chmst - test_item - 22 Aug 2020 - Tested successfully
avatar chmst
chmst - comment - 22 Aug 2020

I have tested this item successfully on ed6dd47


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar brianteeman
brianteeman - comment - 22 Aug 2020

This type of element really should be set o not be printed

@media print { .back-top{ display: none; } }

avatar chmst
chmst - comment - 22 Aug 2020

@infograf768 The template structure with colours and margins / paddings is work in progress.

avatar hans2103 hans2103 - test_item - 26 Aug 2020 - Tested successfully
avatar hans2103
hans2103 - comment - 26 Aug 2020

I have tested this item successfully on baac7fb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar hans2103
hans2103 - comment - 26 Aug 2020

print styling will be taken care of in redesign of Cassiopeia. George mentioned https://twitter.com/dgrammatiko/status/1298231873425092609?s=21 which is interesting


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar alikon
alikon - comment - 26 Aug 2020

i really would like to close this pointing to a real pr , can you share a link ?

avatar hans2103
hans2103 - comment - 26 Aug 2020

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

avatar chmst chmst - test_item - 26 Aug 2020 - Tested successfully
avatar chmst
chmst - comment - 26 Aug 2020

I have tested this item successfully on baac7fb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar richard67 richard67 - change - 26 Aug 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 26 Aug 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30441.

avatar infograf768 infograf768 - change - 26 Aug 2020
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: ?
avatar infograf768 infograf768 - close - 26 Aug 2020
avatar infograf768 infograf768 - merge - 26 Aug 2020
avatar infograf768
infograf768 - comment - 26 Aug 2020

Tks.

Reminder

The module displayed in the footer position is real bad and should be corrected.
Screen Shot 2020-08-26 at 10 49 04

avatar richard67
richard67 - comment - 19 Sep 2020

@Scrabble96 You know that you have to switch it on in Cassiopeia's template style settings in the "Advanced" tab?

avatar Scrabble96
Scrabble96 - comment - 19 Sep 2020

@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.

avatar richard67
richard67 - comment - 19 Sep 2020

@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.

avatar Scrabble96
Scrabble96 - comment - 19 Sep 2020

@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.

avatar richard67
richard67 - comment - 19 Sep 2020

Sorry if I sounded too harsh. Was a long day for me, too.

Add a Comment

Login with GitHub to post a comment