Skip to content

[BUG] Origine line-height with units #3733

Closed

Description

@math-GH

@Frenzie does not like the line-height with units (see: #3731 (comment))

grafik

Why it would make sense: https://css-tricks.com/almanac/properties/l/line-height/#unitless-line-heights

Expected behavior
no units

Environment information (please complete the following information):

  • FreshRSS version: 1.18.1

Activity

  1. Frenzie commented on Jul 29, 2021

    @Frenzie
    Member

    To illustrate the problem:

    <!DOCTYPE html>
    <style>
    div {
    	font-size: x-small;
    	line-height: 2em;
    }
    p {font-size: 2rem}
    .proper {
    	line-height: 2;
    }
    </style>
    <div>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    	<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
    </div>
    <div class="proper">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    	<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
    </div>

    Screenshot_2021-07-29 Screenshot

    As you can see 2 and 2em are identical for the intended target, but it blows up for descending elements, even if in practice usually less dramatically. In fact it's very well possible that most of the line-height declarations above only needed declaring in the first place because of this mistake.

  2. math-GH commented on Jul 29, 2021

    @math-GH
    ContributorAuthor

    Are there differences between line-height: 2 and line-height: 200%?

  3. Frenzie commented on Jul 29, 2021

    @Frenzie
    Member

    Yes, 200% is the same as 2em. That's what causes the problem above. If 200% is 60px, it's always 60px. It's a one time declaration of the value, it doesn't become "200%" for children. For children it's whatever 200% turned out to be.

  4. added
    UI 🎨
    on Aug 4, 2021
  5. math-GH commented on Aug 17, 2021

    @math-GH
    ContributorAuthor

    I see that the base-theme has the same issue, that line-height has em or px :/

  6. added
    System care
    on Aug 21, 2022
  7. self-assigned this
    on Aug 21, 2022
  8. added this to the 1.21.0 milestone on Aug 21, 2022
  9. modified the milestones: 1.21.0, 1.20.1 on Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

System careUI 🎨

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions