Comments (7)
有个相似的问题,不知是不是用的不对。使用antd-style在基于 antd 二次封装的组件库时,使用了createInstance这个API,并使用这个API返回对象中的StyleProvider去指定container,但是没有生效
<StyleProvider container={document.body}>
<MyComponent></MyComponent>
</StyleProvider>
from antd-style.
🎉 This issue has been resolved in version 3.0.1-beta.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
from antd-style.
@IamFive 试试上面这个版本
from antd-style.
@IamFive 试试上面这个版本
- antd 的 style 现在可以正常插入到指定的container中了。
- antd-style 生成的css还是插入到了host page的document.head中。
我使用的代码如下:
import { extractStaticStyle, StyleProvider as AntdStyleProvider } from "antd-style";
const app = (
// <React.StrictMode>
<ConfigProvider
getPopupContainer={() => popupContainer}
theme={{
token: {
colorPrimary: "#00b96b",
},
// algorithm: theme.compactAlgorithm,
}}
>
<AntdStyleProvider container={head}>
{/* <StyleProvider container={head}> */}
<style type="text/css">{sanitize}</style>
<style type="text/css">{a1}</style>
<style type="text/css">{a2}</style>
<style type="text/css">{c1}</style>
<style type="text/css">{md2}</style>
<style type="text/css">{md3}</style>
<style type="text/css">{md1}</style>
<style type="text/css">{compose}</style>
<AppLauncher />
{/* </StyleProvider> */}
</AntdStyleProvider>
</ConfigProvider>
// </React.StrictMode>
);
from antd-style.
好像是还有点问题,我再修下
from antd-style.
from antd-style.
🎉 This issue has been resolved in version 3.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from antd-style.
Related Issues (20)
- 🐛[BUG] 在 qiankun 中使用 StyleProvider 会导致 antd 组件样式插入位置不正确 HOT 10
- 🐛[BUG] umijs 配置自定义 prefixCls antd-style 无法获取到自定义 prefixCls HOT 5
- 👑 [需求] 能否不依赖 antd HOT 1
- 🧐[问题] 求问怎么使用媒体查询 @media screen HOT 1
- 🧐[问题]createInstance里面的customToken有没有办法从antd token 里面获取值? HOT 1
- 🧐[问题]在nextjs中使用 ConfigProvider 配置的主题token在服务端和客户端值不一致 HOT 2
- 👑 [需求] 是否可以导出umd格式的版本 这样可以和umd版本的antd一起使用 HOT 1
- 🐛[BUG] StyleProvider stylisPlugins 在nextjs中不生效
- 👑 [需求] 是否可以有继承的机制 HOT 1
- 🐛[BUG] createStyles token ts 提示有问题 HOT 5
- 👑 [需求] createStyles传入的函数里面的参数能不能增加antdPrefixCls HOT 1
- Typography.Text 样式闪烁 HOT 2
- 🧐[问题] Antd 被应用于外部库
- 🐛[BUG]nextjs app router,createStyles在服务端未生成style标签导致页面闪烁。 HOT 6
- 👑 [需求]在nextjs中样式提取到静态文件 HOT 1
- 👑 [需求] 运行时有没有办法把css里面的px自动转换为vw? HOT 1
- 🧐[问题]Cannot read properties of null (reading 'useContext') HOT 6
- 🧐[问题] antd-style对不同浏览器的兼容性如何?浏览器版本有要求吗? HOT 1
- 👑 [需求]能不能出一个更简短创建css样式的api HOT 2
- 🐛[BUG] 用 createGlobalStyle 创建的样式存在卸载问题 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antd-style.