Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7291 +/- ##
=======================================
Coverage 99.47% 99.47%
=======================================
Files 271 271
Lines 10947 10947
Branches 2618 2618
=======================================
Hits 10889 10889
Misses 58 58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7431276 to
22d8397
Compare
This is a known issue: https://stackoverflow.com/questions/78717295, tailwindlabs/tailwindcss#15005. This test case produces blank output when the template is appended to the shadow DOM, but works if appended to the container's light DOM. <html>
<body>
<template id="template">
<style>
@property --border-style {
syntax: '*';
inherits: false;
initial-value: solid;
}
@property --border-color {
syntax: '<color>';
inherits: false;
initial-value: red;
}
.foo {
border-style: var(--border-style);
border-color: var(--border-color);
border-width: 1px;
width: 20px;
height: 20px;
}
</style>
<div class="foo"></div>
</template>
<div id="container"></div>
<script>
const c = document.querySelector('#container');
const shadow = c.attachShadow({ mode: 'open' });
const t = document.querySelector('#template');
shadow.append(t.content.cloneNode(true));
</script>
</body>
</html> |
|
The issues linked in the previous comment mention a workaround of attaching the |
| @@ -0,0 +1,113 @@ | |||
| /* | |||
There was a problem hiding this comment.
This is annotator.scss and content it imported via @use declarations but adjusted to work with Tailwind v4.
| @@ -0,0 +1,12 @@ | |||
| /* Hide annotation layer while selecting text. | |||
There was a problem hiding this comment.
This is just pdfjs-overrides.scss renamed.
| @@ -0,0 +1,91 @@ | |||
| @import 'tailwindcss' source(none); | |||
There was a problem hiding this comment.
This is sidebar.scss from before and modules that it imported via @use combined into one CSS file and adjusted to work with Tailwind v4.
|
|
||
| @utility container { | ||
| @apply m-auto px-[9px] max-w-[768px]; | ||
| } |
There was a problem hiding this comment.
This is a replacement for the container customizations that were defined in the JS Tailwind configuration previously.
|
Some more general discussion of CSS names and shadow DOM here: https://developer.chrome.com/docs/css-ui/css-names#how_names_and_the_shadow_dom_should_work_together
|
817e7f8 to
a45adec
Compare
- Update dependencies to support Tailwind v4 - Convert SASS source files to CSS where possible, as it is easier to use Tailwind v4 with CSS sources. - Consolidate the small number of styles defined in annotator and sidebar .scss files into the root .css file. - Remove autoprefixer, as it is no longer needed - Replace Tailwind @apply with SASS mixin in highlights.scss The highlights stylesheet is no longer compiled with Tailwind after updating to v4 so `@apply` does nothing. Use a mixin with the same rules. - Convert `all-initial` utility into a class in the `@components` layer so that it has lower precedence than utility classes applied to the same element. - Add an explicit margin to ModalDialog to avoid depending on a default in the user agent style sheet. The Tailwind v4 reset overrides the UA default and sets it to zero.
a45adec to
a63fe25
Compare
|
For future reference, the issue with |
| <dialog | ||
| ref={dialogRef} | ||
| className="relative w-full h-full backdrop:bg-black/50" | ||
| className="relative m-5 w-full h-full backdrop:bg-black/50" |
There was a problem hiding this comment.
This equals 20 pixels in my browser, compared to 19 for the user agent default before.
| screens: { | ||
| lg: '768px', | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Move to a utility defined in CSS. I have simplified the definition there as well.
| '.all-initial': { | ||
| all: 'initial', | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Move to a class in CSS.

This follows similar changes in h and the LMS, but with a few additional changes needed:
Update dependencies to support Tailwind v4
Convert SASS source files to CSS where possible, as it is easier to
use Tailwind v4 with CSS sources.
Consolidate the small number of styles defined in annotator and
sidebar .scss files into the root .css file.
Remove autoprefixer, as it is no longer needed
Replace Tailwind
@applywith SASS mixin in highlights.scssThe highlights stylesheet is no longer compiled with Tailwind after updating to
v4 so
@applydoes nothing. Use a mixin with the same rules.Convert
all-initialutility into a class in the@componentslayer so thatit has lower precedence than utility classes applied to the same element.
Add an explicit margin to ModalDialog to avoid depending on a default
in the user agent style sheet. The Tailwind v4 reset overrides the UA
default and sets it to zero.