The joyride CSS is far too overreaching, making the styling inconsistent with the rest of the Seven theme, the most obvious being the font family.

I think we should prune some of this CSS back so it is a bit less assertive, similar to how a module would implement module.base.css.

the tooltip looking more sevenish

CommentFileSizeAuthor
#74 tour.png53.23 KBManuel Garcia
#73 19210044-tour-styling_tooltips_tour-73.patch14.44 KBaboros
#68 tour-styling_tooltips_tour-1921044-68.patch14.42 KBManuel Garcia
#65 tour-styling_tooltips_tour-1921044-65.patch12.47 KBManuel Garcia
#58 tour-styling_tooltips_tour-1921044-58.patch14.42 KBManuel Garcia
#49 tour-fixed.png205.81 KBsqndr
#48 interdiff.txt2.41 KBrteijeiro
#48 tour-styling_tooltips_tour-1921044-48.patch14.45 KBrteijeiro
#47 tour-styling_tooltips_tour-1921044-46.patch14.5 KBsqndr
#46 tour-views-reduce-width-2.png119.53 KBsqndr
#46 tour-views-reduce-width-1.png153.21 KBsqndr
#46 tour-views-breaks.png149.56 KBsqndr
#45 tour-styling_tooltips_tour-1921044-45-interdiff.txt1.18 KBdasjo
#45 tour-styling_tooltips_tour-1921044-45.patch14.5 KBdasjo
#44 tour-styling_tooltips_tour-1921044-44.patch14.13 KBLewisNyman
#40 interdiff.txt1.74 KBpakmanlh
#40 tour-styling_tooltips_tour-1921044-40.patch13.76 KBpakmanlh
#35 tour-styling_tooltips_tour-1921044-35.patch13.23 KBpakmanlh
#30 tour-styling_tooltips_tour-1921044-30.png74.93 KBAnonymous (not verified)
#27 tour-styling_tooltips_tour-1921044-27.patch13.27 KBpakmanlh
#22 Screen Shot 2014-01-10 at 14.23.06.jpg231.55 KBLewisNyman
#22 Screen Shot 2014-01-10 at 14.10.07.jpg204.71 KBLewisNyman
#18 tour-styling_tooltips_tour-1921044-18.patch13.27 KBpakmanlh
#11 tour-styling_tooltips_tour-1921044-11.patch12.38 KBpakmanlh
#10 Screen Shot 2013-12-20 at 15.09.00.jpg233.08 KBLewisNyman
#8 tour-styling_tooltips_tour-1921044-8.patch13.49 KBpakmanlh
#5 Screen Shot 2013-12-19 at 11.09.23.jpg158.63 KBLewisNyman
#4 tour-styling_tooltips_tour-1921044-4.patch5.83 KBpakmanlh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

Component: system.module » tour.module

Also worth cross posting - http://groups.drupal.org/node/283223

nick_schuch’s picture

Sounds great to me! LewisNyman++

LewisNyman’s picture

Issue tags: +CSS, +styleguide

Technically a style guide issue. We should consolidate this as a component in the style guide.

pakmanlh’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
5.83 KB

@ckrina and me were working on this to make a first approach to resolve the inconsistence of the styles.
Here I attach one patch with an split of the «joyride.css» on two module and theme CSS including little tweaks on properties.
To make a custom mark up to provide a component maybe we should override the definition inside of JavaScript file.
What would the best way to do that? directly Override the jquery.joyride-2.0.3.js file or implement a cleaner / independent override on tour.js

LewisNyman’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
158.63 KB

It looks like we can override the templates when we all the joyride file. Check this part of the documentation.

I did a quick mockup of how it could look, it looks a lot better to me, what do you think?

the tooltip looking more sevenish

You can achieve most of this by reducing the default CSS and HTML.

  • The header is Seven's h2 styling but white.
  • The text is Seven's standard

    styling but white and with a reduced line-height - 18px seemed good to me.

  • The background stays rgba(0,0,0,0.8)
  • The next button can use the button button--primary classes.
  • The background image for the close button can be found here
Wim Leers’s picture

Note that if you want to align CSS more with the Seven style guide, then the CSS should live in the Seven theme's CSS. Therefor Seven-aligned CSS in tour.module.css does not seem acceptable.

LewisNyman’s picture

Indeed, ideally we wouldn't have any CSS in the module apart from positioning.

pakmanlh’s picture

Status: Needs work » Needs review
FileSize
13.49 KB

@ckrina and me were working on that again, here I attach new patch following indications.
We moved the styles inside a new Seven component.

The last submitted patch, 8: tour-styling_tooltips_tour-1921044-8.patch, failed testing.

LewisNyman’s picture

Status: Needs review » Needs work
FileSize
233.08 KB

Visually this looks good in Seven, the problem is there is now no CSS in the module, which means this feature can't function properly without the Seven theme.

This is what it looks like in Stark:

I think we can solve most of this by moving seven/css/components/tour.css back into tour.module.css.

More detailed review:

  1. +++ b/core/modules/tour/js/tour.js
    @@ -102,7 +102,11 @@ Drupal.tour.views.ToggleTourView = Backbone.View.extend({
    +            button  : '<a href=\"#\" class=\"small button button--primary joyride-next-tip\"></a>'
    

    The class small doesn't seem to do anything but if you want to make the button small you can use button--small.

  2. +++ b/core/themes/seven/css/components/tour.theme.css
    @@ -0,0 +1,92 @@
    +  border-radius: 0.5em;
    

    We don't need to set this in ems.

  3. +++ b/core/themes/seven/css/components/tour.theme.css
    @@ -0,0 +1,92 @@
    +}
    ...
    +.joyride-tip-guide .joyride-nub.bottom,
    +.joyride-tip-guide .joyride-nub.left,
    +.joyride-tip-guide .joyride-nub.right {
    +  border-color: rgba(0,0,0,0.8);
    +}
    ...
    +  }
    ...
    +    border-radius: 0;
    ...
    +  .joyride-tip-guide {
    ...
    +@media only screen and (max-width: 767px) {
    ...
    +/* Mobile */
    

    I think we can set the border color by just setting it on the selector above

  4. +++ b/core/themes/seven/css/components/tour.css
    @@ -0,0 +1,126 @@
    +}
    ...
    +
    ...
    +.joyride-tip-guide h6 {
    ...
    +.joyride-tip-guide h5,
    ...
    +.joyride-tip-guide h4,
    ...
    +.joyride-tip-guide h3,
    ...
    +.joyride-tip-guide h2,
    ...
    +.joyride-tip-guide h1,
    ...
    +/* Typography */
    

    Empty selector

  5. +++ b/core/themes/seven/css/components/tour.css
    @@ -0,0 +1,126 @@
    +/* JoyRide Styles */
    +#joyRideTipContent { display: none; }
    +/* Default styles for the container */
    +.joyride-tip-guide {
    

    The standards require a blank line before comments.

  6. +++ b/core/themes/seven/css/components/tour.css
    @@ -0,0 +1,126 @@
    +  }
    +}
    +/* Add a little css triangle pip, older browser just miss out on the fanciness of it */
    +.joyride-tip-guide .joyride-nub {
    

    Another blank line required here

  7. +++ b/core/themes/seven/css/components/tour.theme.css
    @@ -0,0 +1,92 @@
    +}
    ...
    +  color: #fff;
    ...
    +.joyride-tip-guide h5,
    +.joyride-tip-guide h6 {
    ...
    +.joyride-tip-guide h4,
    ...
    +.joyride-tip-guide h3,
    ...
    +.joyride-tip-guide h2,
    ...
    +.joyride-tip-guide h1,
    ...
    +/* Typography */
    

    I think we only really use the h2 here? Do we need all the headers? Maybe

pakmanlh’s picture

Status: Needs work » Needs review
FileSize
12.38 KB

Thanks a lot for the review. Here I attach new patch following your indications, I hope be correct now.

The last submitted patch, 11: tour-styling_tooltips_tour-1921044-11.patch, failed testing.

klonos’s picture

pakmanlh’s picture

The last submitted patch, 11: tour-styling_tooltips_tour-1921044-11.patch, failed testing.

pakmanlh’s picture

Seems that is necessary modify the test "Drupal\Tests\Core\Extension\ThemeHandlerTest" to include the new css files proposed in this issue in Seven theme, but I don't know if this change can do from this issue...

LewisNyman’s picture

Yeah you can add the file to the test when you add it to the theme. We've had to do the same with all the other style guide issues.

pakmanlh’s picture

Status: Needs work » Needs review
FileSize
13.27 KB

@ckrina and me attached the patch again including the test modified.

Status: Needs review » Needs work

The last submitted patch, 18: tour-styling_tooltips_tour-1921044-18.patch, failed testing.

pakmanlh’s picture

Status: Needs work » Needs review

Seems like the test which failed (GlossaryTest) it doesn't concern about this issue, we modified the "ThemeHandlerTest" and now this passed... I'll launch the test again...

pakmanlh’s picture

LewisNyman’s picture

Status: Needs review » Needs work
FileSize
204.71 KB
231.55 KB

Great! Not a lot to fix code wise:

  1. +++ b/core/modules/tour/css/tour.module.css
    @@ -44,3 +49,98 @@
    +.joyride-tip-guide .joyride-nub.bottom {
    +  bottom: -28px;
    +  bottom: none;
    +}
    

    Duplicate properties

  2. +++ b/core/modules/tour/css/tour.module.css
    @@ -44,3 +49,98 @@
    +.joyride-tip-guide p {
    +  margin: 0 0 18px 0;
    +}
    

    This is probably one of the few places we could get away with using ems.

I did notice this when viewing in the stark theme:
the tooltips missing a background in stark
All we need to fix this is a white background or something in the module CSS so the text is readable.

I also noticed that the alignment of the tooltips are slightly off, is there anything we can do about that using minus margins?
the tooltip slightly misaligned

pakmanlh’s picture

Ok in general! I did the two tweaks in few minutes and I have a new patch ready.
Although about the last comment I think to allow put minus margin at only "left" and "right" tooltips (which are misaligned) we would need a class in the general wrapper of the tip that marked the kind of tip. But now the TipLocation variable only is puts a classname on joyride-nub div inside of the general wrapper... and it doesn't work
I've had a look at the tour.js but I don't see how to do that... I'll try to further investigate but all the support are wellcome.

nick_schuch’s picture

Hi pakmanlh!

Text tips have a 'location' property assigned to them. This set the top/left/right/bottom positions. We could use that to provide a class to the wrapper of the tip.

Would that help unblock this issue for you?

pakmanlh’s picture

Yes, but the question is "How" to do that :P
Anyway thanks for the feedback!

LewisNyman’s picture

hmm, it actually looks more complex than I thought. I don't think we should tackle alignment in this issue because it seems more like a problem of the plugin itself than anything we've done.

pakmanlh’s picture

Ok! Here I attach a new patch that fix the last comments ignoring the vertical misaligned.

pakmanlh’s picture

Status: Needs work » Needs review
ry5n’s picture

Visually tested agains HEAD in Seven and Stark. Looks good, except for the alignment issue mentioned before. Actually, this only seems to be an issue when the Joyride tip is pointing horizontally at an item, and could be resolved by applying the background/border/radius to the inner content area and shifting it up/down.

Anonymous’s picture

Using the patch in #27 with small resolution (mobile) looks like the attached screenshot. I think the background should be dark also.

Update: Looks good now.

LewisNyman’s picture

I seems tricky to expose the correct classes to modify the position of the tool tip without modifying joyride. Seems like an issue we should move into the joyride issue queue. This is also not an issue introduced by this patch so it seems silly to fix it here.

LewisNyman’s picture

The last submitted patch, 27: tour-styling_tooltips_tour-1921044-27.patch, failed testing.

nick_schuch’s picture

Status: Needs review » Needs work
pakmanlh’s picture

Status: Needs work » Needs review
FileSize
13.23 KB

I re-rolled the patch again.

klonos’s picture

LewisNyman’s picture

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

It doesn't seem right to have to keep rerolling this patch because of a problem that wasn't introduced as part of this patch and we don't really have a plan to solve yet. I'm happy to create a follow up.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
jquery.joyride:
  remote: https://github.com/zurb/joyride
  version: v2.0.3
  js:
    js/jquery.joyride-2.0.3.js: {}
  css:
    component:
      css/joyride-2.0.3.css: { media: screen }
  dependencies:
    - core/jquery
    - core/jquery.cookie

This refers to the removed CSS file?

Plus we're breaking up the external library - is that really the done thing? I guess this is okay

.joyride-tip-guide .joyride-nub.top {
  top: -28px;
  bottom: none;
}

.joyride-tip-guide .joyride-nub.right {
  top: 22px;
  bottom: none;
  left: auto;
  right: -28px;
}

.joyride-tip-guide .joyride-nub.left {
  top: 22px;
  left: -28px;
  right: auto;
  bottom: none;
}

W3C: none is not a bottom value

.toolbar .tour-toolbar-tab button.active {
  background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
  background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
}

Why only webkit? http://www.w3schools.com/css/css3_gradients.asp

+++ b/core/modules/tour/js/tour.js
@@ -102,7 +102,11 @@
+           },

jshint says that this is wrongly indented and PHPStorm complains about the comma :)

pakmanlh’s picture

Status: Needs work » Needs review
FileSize
13.76 KB
1.74 KB

I rerolled the patch with the Alex indications (thanks a lot!)
Only that I'm not sure if it would necessary remove the css file reference at the component definition.

Status: Needs review » Needs work

The last submitted patch, 40: tour-styling_tooltips_tour-1921044-40.patch, failed testing.

tkoleary’s picture

Not sure why it fails testing but it looks awesome when I test it on simplytest.me.

Only issue I see is unrelated to this one, the arrows not quite pointing at the right thing.

pakmanlh’s picture

The test fails because it try to remove joyride.css that it has been moved to new path... I see that last friday but I had not time yet to solve, because maybe this fact implies modify component and some test... Feel free to reroll, I'll try to do as soon as possible :P

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
14.13 KB

I've rerolled and included this change:

+++ b/core/modules/tour/css/tour.module.css
@@ -18,7 +18,9 @@
+  background-image:    -moz-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
+  background-image:      -o-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);
+  background-image:   linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);

In other patches we've kept the spacing consistent (one space) for all gradient properties.

dasjo’s picture

Great to see tour module being aligned to the style guide - this looks a lot better!

I've found it confusing to mix em based & pixel based units for defining the padding of the tooltip container, see .tour-progress, .joyride-content-wrapper and .joyride-close-tip.

In the attached patch iteration, i tried to fix the problem of repeating padding units of the parent .joyride-content-wrapper by moving its padding up to the .joyride-tip-guide. This way we can just use right: 0; to declare the children elements to be positioned at some corner instead of formerly mixing pixels and ems.

sqndr’s picture

+++ b/core/modules/tour/css/tour.module.css
@@ -18,29 +18,138 @@
+    width: 95%;

This doesn't look good on mobile (or smaller screens):

I created a patch that changes the width to 87%, which is a kinda weird number ... but it fixes the problem:

Another thing to do, might be to completely remove the width attribute. This way - the tour popups don't fill up the entire screen, yet it still looks good.

sqndr’s picture

rteijeiro’s picture

Looks nice! Some minor clean-up and ready to go (I hope).

sqndr’s picture

FileSize
205.81 KB

This patch looks fine. This makes the tour popup looks good for all breakpoints. Nice!

tamasd’s picture

Status: Needs review » Reviewed & tested by the community

Works fine for me too

LewisNyman’s picture

Status: Reviewed & tested by the community » Needs work

we have one thing left to do with is address @alexpott's comment:

jquery.joyride:<br>&nbsp; remote: https://github.com/zurb/joyride<br>&nbsp; version: v2.0.3<br>&nbsp; js:<br>&nbsp;&nbsp;&nbsp; js/jquery.joyride-2.0.3.js: {}<br>&nbsp; css:<br>&nbsp;&nbsp;&nbsp; component:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; css/joyride-2.0.3.css: { media: screen }<br>&nbsp; dependencies:<br>&nbsp;&nbsp;&nbsp; - core/jquery<br>&nbsp;&nbsp;&nbsp; - core/jquery.cookie

This refers to the removed CSS file?
Plus we're breaking up the external library - is that really the done thing? I guess this is okay

I'm happy to remove this CSS file, it's way too opinionated to be useful, maybe once they tone it down we can include it again. This means we just need to remove the reference in the yml file.

Bojhan’s picture

@Lewis I wonder if this should have more round corners.

pakmanlh’s picture

Status: Needs work » Reviewed & tested by the community

The reference in the .yml file it was removed, so I think is all ready :)

scor’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 48: tour-styling_tooltips_tour-1921044-48.patch, failed testing.

Bojhan’s picture

FYI, my concerns are resolved its only in mobile that we lose the corners because it would otherwise cramp the textarea too much

LewisNyman’s picture

Issue tags: +Needs reroll
Manuel Garcia’s picture

rock & re-roll!

rteijeiro’s picture

Status: Needs work » Needs review

No review, no rock :P

Status: Needs review » Needs work

The last submitted patch, 58: tour-styling_tooltips_tour-1921044-58.patch, failed testing.

rteijeiro’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 58: tour-styling_tooltips_tour-1921044-58.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll
+++ b/core/themes/seven/css/components/tour.theme.css
@@ -0,0 +1,81 @@
++/**
+ * @file
+ * Styles for Tour theme.
+ */

It looks like the patch adds an extra '+' here? This break all the css in the file

Manuel Garcia’s picture

Great chatch Lewis!
No clue how that happened, here it is again without that plus sign.

Manuel Garcia’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Needs work

It's missing the CSS file, saving the testbot some work.

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
14.42 KB

sorry forgot to add it before making the patch... here it is again

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Still looks good!

LewisNyman’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 68: tour-styling_tooltips_tour-1921044-68.patch, failed testing.

aboros’s picture

Assigned: Unassigned » aboros

rerolling.

aboros’s picture

Assigned: aboros » Unassigned
Status: Needs work » Needs review
FileSize
14.44 KB

This is just a re-roll of #68.

Manuel Garcia’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
53.23 KB
$ git apply -v 19210044-tour-styling_tooltips_tour-73.patch
Checking patch core/assets/vendor/jquery-joyride/joyride-2.0.3.css...
Checking patch core/core.libraries.yml...
Checking patch core/modules/tour/css/tour.module.css...
Checking patch core/modules/tour/js/tour.js...
Checking patch core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php...
Checking patch core/themes/seven/css/components/tour.theme.css...
Checking patch core/themes/seven/seven.info.yml...
Applied patch core/assets/vendor/jquery-joyride/joyride-2.0.3.css cleanly.
Applied patch core/core.libraries.yml cleanly.
Applied patch core/modules/tour/css/tour.module.css cleanly.
Applied patch core/modules/tour/js/tour.js cleanly.
Applied patch core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php cleanly.
Applied patch core/themes/seven/css/components/tour.theme.css cleanly.
Applied patch core/themes/seven/seven.info.yml cleanly.

Checked the content view tour.. looks fine =)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 73: 19210044-tour-styling_tooltips_tour-73.patch, failed testing.

pakmanlh’s picture

pakmanlh’s picture

Status: Needs work » Reviewed & tested by the community

After tested in my local environment I launched the test again and now the test passed :)

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 9b87b2b and pushed to 8.x. Thanks!

  • Commit 9b87b2b on 8.x by alexpott:
    Issue #1921044 by pakmanlh, Manuel Garcia, rteijeiro, dasjo, aboros,...
tstoeckler’s picture

Is there any reason for removing the CSS file? It seems removing it from the libraries definition should be enough, right? That way we wouldn't have to hack an external library.

sun’s picture

Status: Fixed » Needs work
  1. index ba103f0..0000000
    --- a/core/assets/vendor/jquery-joyride/joyride-2.0.3.css
    

    This file shouldn't have been removed.

  2. +++ b/core/core.libraries.yml
    @@ -331,9 +331,6 @@ jquery.joyride:
    -  css:
    -    component:
    -      assets/vendor/jquery-joyride/joyride-2.0.3.css: { media: screen }
    
    +++ b/core/themes/seven/seven.info.yml
    @@ -10,6 +10,7 @@ stylesheets:
    +    - css/components/tour.theme.css
     stylesheets-override:
    

    Why didn't you use the stylesheets-override facility in seven's .info.yml file to override the default joyride stylesheet?

  3. +++ b/core/modules/tour/css/tour.module.css
    @@ -18,29 +18,132 @@
    +.toolbar .tour-toolbar-tab.toolbar-tab.hidden {
    

    It doesn't look like the Tour module CSS changes were tested in any other core theme?

  4. +++ b/core/modules/tour/css/tour.module.css
    @@ -18,29 +18,132 @@
    +/* JoyRide Styles. */
    

    This appears to be a copy of the original/vendor jQuery Joyride styles...?

    Why were the original styles deleted then?

LewisNyman’s picture

@sun Hey, ok let's talk about 1. We can add the stylesheet back in if that's the correct thing to do, but it massive violates our CSS standards, we can't include it by default unless we exclude it manually for every theme, which seems crazy. Should we keep it in the repo but just not include it in the libraries definition?

Bojhan’s picture

Issue tags: +frontend
LewisNyman’s picture

Status: Needs work » Fixed

Is there any reason for removing the CSS file? It seems removing it from the libraries definition should be enough, right? That way we wouldn't have to hack an external library.

Right now we don't copy external library repos verbatim, we pick and choose the files we want from the repo. We can add the CSS file back in but we can't include it in the library so what's the benefit? We we still pick and choose the JS file when we update the library.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.