Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
[solved] userall.css : Can't override <pre> line-height with DW greebo default template
Avatar
schplurtz (Moderator) #1
Member since Nov 2009 · 513 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Subject: [solved] userall.css : Can't override <pre> line-height with DW greebo default template
Hi,
Default template, DW greebo, firefox 61.0.1

DW default line-height is 1.4 and this is causing me trouble with box-drawing chars in <pre> because there is then some space between the vertical bars. So I want to set line-height to 1 for <pre>. I edit conf/userall.css, add pre { line-height: 1; }, clear all caches, and... FF doesn't want to apply it. I insist and try some variations until I desperately try this  :

div#dokuwiki__site div#dokuwiki__content pre {
    line-heigth: 1 !important;
}
And still, FF won't apply. My selector with 2 ids is defeated by DW simple body rule (lib/tpl/dokuwiki/css/basic.less) :-( :

body {
    font: normal 87.5%/1.4 Arial, sans-serif;
}

I must be doing something wrong. What is the correct way of overriding lineheight in <pre> ?

[Image: https://framapic.org/db65ooTqHBbU/BiqurJylwLo8.png]
This post was edited on 2018-08-06, 16:31 by schplurtz.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4785 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
What you are getting with 1 is 1 x 1.4, since the default font is specified as 87.5/1.4 . So try .9, and  preferably place this in conf/userstyle.css.  I believe that userstyle.css is added in at the end and so gets preference.

Tested in greebo:
#conf/userstyle.css
pre {
line-height: .8 !important
}
This  just about butts the lines up against each other.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
turnermm (Moderator) #3
Member since Oct 2009 · 4785 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
As a suggestion, you might want to use the file tag for your box drawing and assign your line-height property to pre.file:
pre.file{
line-height: .8 !important
}
As far as I can tell DokuWiki doesn't use the file type for any of its own features, but code is used for downloadable code blocks.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
schplurtz (Moderator) #4
Member since Nov 2009 · 513 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Thank you  turnermm !

Your examples work just fine.

In the end it turns out that I misstyped the property name : line-heigth is a typo. FF just can't apply it.

Some more info : There is no need to use !important. Strangely enough line-height:1 or even line-height:1.15
works fine for me, and putting the declaration in userall.css or userstyle.css produce the same result.

My conf/userall.css
pre {
  line-height: 1.15;
}
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-26, 15:32:37 (UTC +01:00)