Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently the Secondary tabs are using the wrong size, spacing and font-size, taking too much vertical space:
Proposed resolution
Correct secondary tabs styles according to the design system. Full specs can be checked on Figma, and here's an screenshot:
User interface changes
Font size will be reduced and vertical spacing will be smaller
Test instructions
- /admin/content
- /admin/people
Comment | File | Size | Author |
---|---|---|---|
#79 | interdiff.txt | 1.04 KB | lauriii |
#72 | Screenshot-2.png | 28.28 KB | nitesh624 |
#72 | screenshot1.png | 38.05 KB | nitesh624 |
#71 | Screenshot 2020-05-07 at 8.02.43 PM.png | 187.96 KB | sauravk |
#71 | interdiff-64-71.txt | 2.8 KB | sauravk |
Comments
Comment #2
ckrinaAdding Figma specs link.
Comment #3
ckrinaComment #4
lauriiiComment #5
reinchekI've applyed the css spacer modification.
.
Comment #6
reinchekComment #7
lauriiiI'm not sure if we can just change the margin of the content header because of the margin specified in the content header is still 2rem. I assume the margin should be 1rem only when there are tabs.
Comment #8
reinchekI'm not sure too... but actually claro doesn't discriminate the margin when there're and there aren't the tabs. The only way to change the tabs space (margin) is to reduce .content-header margin-bottom rule.
I will wait for explainations ...
have a nice day. :)
Comment #9
lauriiiAgreed that it's not clear. I asked for clarification from @ckrina who is one of the designers and the author of this issue.
Comment #10
ckrinaYes, I confirm this space should be smaller when there are secondary tabs because their internal padding leaves enough top visual space.
I'd say if you want to change this bottom margin as a general rule you should then either:
Although the first option might have too many open options.
Comment #11
reinchek@ckrina maybe this could be a nice solution.
I've added a little piece of js code inside the nav-tabs.js library that add the ".with-secondary-tabs" class to the only when really there are the secondary tabs.
Attached the screenshots that show the behaviors.
The code that add the discriminant class is:
Comment #12
reinchekComment #13
Vinodhini.E CreditAttribution: Vinodhini.E at UniMity Solutions Pvt Limited commented#11, I have reviewed the patch and its working for me. I am attaching the screenshot after applying the patch.
Comment #14
naresh_bavaskar+1 RTBC
#11 Patch works for me.
Comment #15
naresh_bavaskarComment #16
lauriiiI'm not sure if we need JavaScript to get this done given that this isn't really interactive. Let's try to come up with a CSS only solution for this.
Comment #17
reinchekI've tried, before the js solution, to handle the issue with pure css solution. But as you can see i've failed!
The other thing that conviced me to adopt a js solution it was the fact that in another place (if i remember right) also was used to resolve a similar issue.
(ps: happy new year)
Comment #18
sibustephen CreditAttribution: sibustephen as a volunteer commentedHi, have attached a screenshot where the space seems to be good, when we reduce it to 1rem, have raise a patch for the same, do review.
Comment #19
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedComment #20
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedI have created a patch. Below points are implemented in this patch:
Kindly review the patch and screenshot attached.
Comment #21
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedComment #22
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedAdding interdiff for the patch in comment #20.
Comment #23
sibustephen CreditAttribution: sibustephen as a volunteer commented@kishor_kolekar can you reroll my patch #18 and then add your code for fix with interdiff, in order to track the changes.
Comment #24
sibustephen CreditAttribution: sibustephen as a volunteer commentedComment #25
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedHere I have re-rolled patch #18
Made changes those done in patch #20 and added interdiff.
Comment #26
lauriiiUnfortunately, this approach doesn't match with the style guide. See #2.
Comment #27
sibustephen CreditAttribution: sibustephen as a volunteer commentedComment #28
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedpreviously added the code in incorrect file , so added the code in correct file and created the patch with the interdiff
Comment #29
naresh_bavaskarComment #30
naresh_bavaskar#28 applied successfully. The secondary tab size is looking good to me.
Comment #31
lauriiiUnfortunately, we can't simply just change the margin of the content header because of the margin specified in the content header is still 2rem. The margin should be 1rem only when there are tabs.
Comment #32
kishor_kolekar CreditAttribution: kishor_kolekar as a volunteer and at QED42 commentedhere is the simple css solution .
kindly review my patch
Comment #33
AkashKumar07 CreditAttribution: AkashKumar07 commentedComment #34
szalapski.adam@gmail.com CreditAttribution: szalapski.adam@gmail.com at Pegasystems commentedComment #35
jordanwood CreditAttribution: jordanwood at Northern Commerce commentedPatch from #34 applied cleanly and matches the proposed resolution.
Comment #36
hotwebmatter CreditAttribution: hotwebmatter as a volunteer commentedThis looks good, passes tests and meets specification. RTBC+1
Comment #37
Krzysztof DomańskiThanks all for working on Claro theme!
1. @Adam Szałapski At the DGCW, I mentioned that drupal does not use compilers to generate css files. I was wrong.
Since Drupal 8.8.x we're using PostCSS for compiling creating CSS so we also need to change
*.pcss.css
files. See Drupal core using PostCSS for development.2. Margin when there are no secondary tabs. It is a bit problematic.
@lauriii Let's add 2rem space to
.page-content
. Then we can use a 1rem space to.content-header
. What do you think about it?Comment #38
szalapski.adam@gmail.com CreditAttribution: szalapski.adam@gmail.com at Pegasystems commentedThanks, Krzysztof Domański for valuable information about PostCSS configuration and few tips to fix spacing issues. Please review my newest patch.
Comment #39
Krzysztof DomańskiTested manually. Looks good to me.
Comment #40
lauriiiThe current patch increases margin on the bottom of the tabs on mobile. Is this intentional?
Comment #41
KondratievaS CreditAttribution: KondratievaS at Skilld commentedSpacing between tabs is OK
Comment #42
ckrinaHi @KondratievaS, as @lauriii is pointing, the spacing was smaller on mobile/small devices where we have less space. And as per designs, it should still be smaller:
https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system...
The reason behind this is because in smaller devices we have less space, so we need to leave less spacing.
Thanks for working on this!
Comment #43
KondratievaS CreditAttribution: KondratievaS at Skilld commentedComment #44
Krzysztof Domański1. Spaces on mobile have been changed according to the Drupal Design system.
2. Also the space above the "Add content" button is still the same.
Comment #45
Krzysztof DomańskiOh right, it needs work.
Comment #46
kostyashupenkoComment #47
kostyashupenkoComment #48
KondratievaS CreditAttribution: KondratievaS at Skilld commentedTested patch from #47 and result is OK
Comment #49
KondratievaS CreditAttribution: KondratievaS at Skilld commentedComment #50
lauriiiThank you all for working on this! This is great progress.
It seems like this should be 1.5rem in mobile.
Comment #51
Neslee Canil PintoComment #52
lauriiiThank you! We shouldn't remove the 2rem completely because it is the correct value for desktop. We should use media query for allowing this property to take effect on large viewports.
Comment #53
Neslee Canil PintoComment #54
KondratievaS CreditAttribution: KondratievaS at Skilld commentedTested patch from #53 and result is OK
Comment #55
KondratievaS CreditAttribution: KondratievaS at Skilld commentedComment #56
lauriiiLet's regenerate the layout.css 😇
We have generally preferred usage of min-width selectors on media queries.
Comment #57
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #58
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #59
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #60
shaktikit looks good to me.
Comment #61
BhumikaVarshney CreditAttribution: BhumikaVarshney as a volunteer and at OpenSense Labs commentedHi,
The #59 patch is working for me.
Comment #62
lauriiiThere's a regression on the secondary tabs focus effect:
Comment #63
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #64
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedFixed secondary tabs focus effect.
Comment #65
KondratievaS CreditAttribution: KondratievaS at Skilld commentedTested patch from #64 in Chrome, FF, Safari, IE for mobile and desktop resolutions and result is OK
Comment #66
KondratievaS CreditAttribution: KondratievaS at Skilld commentedComment #68
xjmComment #69
lauriiiDiscussed with @ckrina about the secondary tabs designs and it seems like there are at least a couple of things that were clarified in the designs that need to be addressed here too:
Comment #70
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #71
sauravk CreditAttribution: sauravk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #72
nitesh624patch https://www.drupal.org/files/issues/2020-05-07/3097651-71.patch fixes the css problem see the below screenshot
Comment #73
atul4drupal CreditAttribution: atul4drupal at Srijan | A Material+ Company commented#71 Looks good,addresses concerns from #69.
Comment #74
lauriiiThis looks great! We're currently on a code freeze but I will get back to this once the freeze is over.
Comment #78
lauriiiI had to run
yarn run lint:css --fix
andyarn run build:css
. Interdiff attached here.Committed 2d166ac and pushed to 9.1.x, 9.0.x and 8.9.x. Thanks!
Comment #79
lauriiiHere's the missing interdiff