Inject Stylus into shadowRoots

inject styles of stylus-addon in shadowRoot

المؤلف
hdyzen
التثبيت اليومي
0
إجمالي التثبيت
0
التقييمات
0 0 0
الإصدار
1.1
تم إنشاؤه
29-06-2025
تم تحديثه
29-06-2025
Size
1.57 KB
الترخيص
GPL-3.0-only
ينطبق على
جميع المواقع

Inject Stylus into shadowRoots

This userscript injects styles from the Stylus extension directly into shadowRoot instances, allowing you to style the content of web components.


How to style content inside a shadowRoot

:host

To apply styles only to the content within a shadowRoot, use the :host pseudo-selector in your Stylus styles. :host refers to the element that contains the shadowRoot (the shadow host).

/* All elements */
* {
  border: 1px violet;
}
/* Only elements inside the shadowRoot */
:host * {
  border: 1px solid mediumpurple;
}

Similar forms:

长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

一年攒够 12 元

云驰互联

云驰互联