Inject stylus in Shadow DOM

inject stylus to shadowRoot

질문, 리뷰하거나, 이 스크립트를 신고하세요.
개발자
hdyzen
일일 설치수
0
총 설치수
12
평점
1 0 0
버전
0.1.2b
생성
2024-02-07
갱신
2024-02-28
라이선스
MIT
동작 사이트

Add styles of stylus addon in shadowRoot

⚠️Warning - Use this on sites like sh.reddit.com that has hundreds of shadowRoots, may cause some performance issues


Modify the match metadata for the site you want to execute the inject or add through the script manager in the script tab, example for match:

// @match           https:/www.reddit.com/*
// @match           https:/www.wikipedia.com/*
// @match           https:/www.anothersite.com/*
// @match           https:/greasyfork.org/*

To apply styles only to elements within shadowRoot use the :host pseudo-class, example:

:host [selector] {
  border: 1px solid red;
}
:host * {
  border: 1px solid blue;
}

Version [0.1.1a] supports live updating, no longer need to reload the page to apply the changes

The script monkey patches attachShadow to add the stylus, it is not recommended, but it is functional, if you really need to add styling to elements inside the shadowR oot, this will work.