support feature linke `StyleSheetManager` in styled-components

未关闭
#1,410 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
typescript
领域
frontend, web-dev

调研方向

先阅读 src/main.tsx 中链接的示例以及相关 issue #496,以了解针对 Shadow DOM 所要求的 StyleSheetManager 行为。该 issue 没有指出任何 Linaria 实现文件或测试,因此首先定位现有的全局样式注入入口,并定义所需的 API 和测试覆盖范围,以证明样式会应用于 shadow root 内部。

由索引模型根据 Issue 内容生成。

描述

feature: proposal 💬 needs: triage 🏷

repo https://github.com/yzqbugs/linaria-feat

Describe the feature

so we could provide a StyleSheetManager to set where to put our style in, like StyleSheetManager

Motivation

all styles are generated in global scope. It's not usable for shadowDom,if we could provide a styleSheetManager to tell linaria to inject css to shadowdom element,all styles will take effect

below is my code, showing use styleSheetManager in shadowDom

https://github.com/yzqbugs/linaria-feat/blob/364eaadf133818ad59030fd567669a19850dbc2b/src/main.tsx#L1-L59

image

we could see styled-components generate style beside dom, so styles could take effect

Possible implementations

Related Issues

#496

主要语言
TypeScript
星标
12.4k
派生
413
平均合并
1 天 49 分钟
30 天内合并 PR
14

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/linaria 的其他 Issue

查看 callstack/linaria 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。