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

feat: Update CSS user agent default style sheet #1255

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

MurakamiShinyu
Copy link
Member

@MurakamiShinyu MurakamiShinyu commented Jan 29, 2024

This updates the CSS user agent default stylesheet in Vivliostyle.js to conform to the latest web standards. (Issue: #1128)

Summary of changes:

Elements Property Old New
h2 margin-block 0.75em 0.83em
h3 margin-block 0.83em 1em
h4 margin-block 1em 1.33em
h5 margin-block 1em 1.67em
h6 margin-block 1em 2.33em
h6 font-size 0.75em 0.67em
h1, h2, h3, h4, h5, h6 font-weight bolder bold
blockquote, ol, ul, dir, menu margin-block 0 1em
[dir=ltr], [dir=rtl] unicode-bidi embed isolate
figure margin-block -- 1em
figure margin-inline -- 40px
hr margin-block -- 0.5em
hr[color], hr[noshade] border-style -- solid
dfn font-style -- italic
listing, plaintext, xmp white-space -- pre
pre[wrap] white-space -- pre-wrap
details, dialog, legend, listing, optgroup, option, plaintext, search, xmp display -- block
table box-sizing -- border-box
table border-collapse -- separate
table text-indent -- initial
tr vertical-align -- inherit

Also this removes the following styles that have no effect or should be leave to the browser's default:

  • html, address, blockquote, body, dd, div, dl, dt, fieldset, form, … { unicode-bidi: normal; }
  • h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dir, menu, fieldset, form { margin-inline: 0; }
  • fieldset, form { margin-block: 1em; }
  • audio, video { break-inside: avoid; }
  • rtc, rt { font-variant-east-asian: ruby; }
  • rtc:lang(zh), rt:lang(zh) { ruby-align: center; }

Copy link

vercel bot commented Jan 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vivliostyle ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 8:39am

This updates the CSS user agent default stylesheet in Vivliostyle.js to conform to the latest web standards. (Issue: #1128)

Summary of changes:

| Elements                | Property     | Old    | New     |
|-------------------------|--------------|--------|---------|
| h2                      | margin-block | 0.75em | 0.83em  |
| h3                      | margin-block | 0.83em | 1em     |
| h4                      | margin-block | 1em    | 1.33em  |
| h5                      | margin-block | 1em    | 1.67em  |
| h6                      | margin-block | 1em    | 2.33em  |
| h6                      | font-size    | 0.75em | 0.67em  |
| h1, h2, h3, h4, h5, h6  | font-weight  | bolder | bold    |
| blockquote, ol, ul, dir, menu | margin-block | 0 | 1em    |
| [dir=ltr], [dir=rtl]    | unicode-bidi | embed  | isolate |
| figure                  | margin-block | --     | 1em     |
| figure                  | margin-inline| --     | 40px    |
| hr                      | margin-block | --     | 0.5em   |
| hr[color], hr[noshade]  | border-style | --     | solid   |
| dfn                     | font-style   | --     | italic  |
| listing, plaintext, xmp | white-space  | --     | pre     |
| pre[wrap]               | white-space  | --     | pre-wrap|
| details, dialog, legend, listing, optgroup, option, plaintext, search, xmp | display | -- | block |
| table                   | box-sizing   | --     | border-box |
| table                   | border-collapse | --  | separate |
| table                   | text-indent  | --     | initial  |
| tr                      | vertical-align | --   | inherit  |

Also this removes the following styles that have no effect or should be leave to the browser's default:

- `html, address, blockquote, body, dd, div, dl, dt, fieldset, form, … { unicode-bidi: normal; }`
- `h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dir, menu, fieldset, form { margin-inline: 0; }`
- `fieldset, form { margin-block: 1em; }`
- `audio, video { break-inside: avoid; }`
- `rtc, rt { font-variant-east-asian: ruby; }`
- `rtc:lang(zh), rt:lang(zh) { ruby-align: center; }`
@MurakamiShinyu MurakamiShinyu merged commit 1747a92 into master Jan 29, 2024
5 checks passed
@MurakamiShinyu MurakamiShinyu deleted the feat/update-ua-stylesheet branch January 29, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant