Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(upgrade_to_30): add line-height change docs #12082

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@ Nextcloud now provides meaningful default styles for heading elements.
This can cause visual regressions if your code does not explicitly set font size and weight.
If you need to use heading elements outside of text content, you might need to adjust their styles.

Line height
^^^^^^^^^^

`--default-line-height` CSS variable is a unitless value `1.5` instead of a unit value `24px`:
susnux marked this conversation as resolved.
Show resolved Hide resolved
- `line-height` of an element with a non-default font size is now adjusted to the element's font size
ShGKme marked this conversation as resolved.
Show resolved Hide resolved
- Unit calculation isn't valid anymore. Use [lh](https://developer.mozilla.org/en-US/docs/Web/CSS/length#lh) unit instead.
susnux marked this conversation as resolved.
Show resolved Hide resolved

```diff
ShGKme marked this conversation as resolved.
Show resolved Hide resolved
element1 {
/* Invalid CSS calculation. Use lh unit instead */
- height: calc(var(--default-line-height) * 2);
+ height: 2lh;

- padding-left: calc(var(--default-line-height) + 10px);
+ padding-left: calc(1lh + 10px);
}

element2 {
font-size: calc(var(--default-font-size), 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
font-size: calc(var(--default-font-size), 2);
font-size: calc(var(--default-font-size) * 2);

Or I didn't get whether it was a multiplier or fallback value


/* Valid usage. No changes are needed if the font-size is default. */
line-height: calc(var(--default-line-height) * 2);

/* No line-height adjustment is needed anymore */
- line-height: calc(var(--default-line-height), 2);
}
```

Added APIs
^^^^^^^^^^

Expand Down
Loading