![](/img/trans.png)
[英]How to import an createEmotionServer in remix js
在 remix.js 中,我想從 @emotion/server/create-instance 導入 createEmotionServer。 它給我,錯誤。 這段代碼有什么問題嗎? 導入語句是這樣的: 這只是一個導入語句。 但在混音中它顯示錯誤 我需要從中導入它的任何其他模塊路徑嗎? ...
[英]How to import an createEmotionServer in remix js
在 remix.js 中,我想從 @emotion/server/create-instance 導入 createEmotionServer。 它給我,錯誤。 這段代碼有什么問題嗎? 導入語句是這樣的: 這只是一個導入語句。 但在混音中它顯示錯誤 我需要從中導入它的任何其他模塊路徑嗎? ...
[英]Can't pass props.style to "@emotion/styled" component
我正在使用情感風格的組件。 我有一個名為Layered的組件,我定義如下: 在我的主要代碼中,我創建了另一個名為<LayeredModified />的組件,它應該是Layered的,帶有一些額外的樣式。 樣式是: Layered本身永遠不會顯式呈現,只有LayeredModified ...
[英]Create-react-app CSR - Applying Content Security Policy (no inline styles) when using Material UI Themes
我們有一個使用 Material UI Themes 庫(使用情感庫)的客戶端呈現 React 應用程序。 偽代碼看起來有點像這樣: 我想開始應用一組內容安全策略規則,包括防止使用內聯 styles 的規則。 因此,我將以下元標記添加到我的 index.html header 中: 這似乎適用於我 ...
[英]Change svg color with vite-plugin-svgr
我正在使用vite和vite -plugin-svgr 。 我想更改MyIcon的顏色。 我試過填充、顏色等,但沒有用。 我應該做些什么?import { ReactComponent as MyIcon } from "../icons/dummy.svg"; function MyCompon ...
[英]How do I fix this css prop horror show using emotion/twin.macro?
我正在努力讓我的twin.macro設置在我的 React 應用程序中運行。 我無法提供我所嘗試過的完整歷史,因為我嘗試過許多不同的東西,但我將概述我當前的設置並概述哪些不起作用。 我正在使用react-app-rewired因為我似乎需要一個自定義的 Babel 配置,顯然create-reac ...
[英]CSP - React webpack, styled-component, mui
我按照這篇文章將 CSP 添加到我的反應應用程序中,它有效,但是當使用 MUI 和樣式化組件時,它們注入的 styles 不起作用,我找不到任何不使用 Next.js SSR 的解決方案. 這是我的 config-overrides.js 文件:const { override } = requi ...
[英]Access other className on hover in emotion css
我使用EmotionCSS 。 我想在關注另一個類名的同時訪問其他類名。 例如我有一個這樣的組件: 樣式文件如下所示: ...
[英]Emotion global theme setting error in react
在設置emotion全局主題的過程中,反復出現引用未知屬性的錯誤。 當前項目使用的情感版本和設置全局主題的代碼如下。 我好像已經正常完成設置了,但是出現如下錯誤是什么原因呢? ...
[英]How can I style a MUI5 Tooltip with emotion?
我通讀了https://stackoverflow.com/a/69821680/239879並嘗試了styled化方法。 我有: 但是 TypeScript 給我一個錯誤: 當我進行build時,我得到: 不確定我的設置有什么不同。 任何幫助,將不勝感激。 ...
[英]Target another component on hover in Emotion/styled MaterialUi
我有一個來自 MUI 的抽屜組件,我使用styled imported from import { styled } from "@mui/material/styles"; 我如何從ListItem定位ListButton ? 這是行不通的。 Ps 我不想從'@emotion/styled'中導 ...
[英]How to fix vite warning: The JSX import source cannot be set?
我正在使用情緒 css 運行帶有 vite 的 React 應用程序。為了在 html 元素上使用情緒的 css 屬性,我需要設置特殊注釋以啟用 vite 構建: 它曾經工作正常,但現在我收到以下警告,我不知道這意味着什么以及如何解決它: ...
[英]I can't import emotion js style with dynamic variable
我有一個如下所示的網頁: 這是我的_app.tsx文件: 這是shared/styles.js : 請注意, blueOnBlack試圖將Futuristic Sci-Fi UI Web Framework樣式放入其自己的可導入變量中。 問題是,當我將blueOnBlack作為Futuristic ...
[英]Limit emotion global styles to a narrower selector
有沒有辦法將情感注入全局 scope 的 styles 限制為更窄的 scope? 我見過 這種使用手寫筆插件添加更窄范圍的 styles 的方法,但這只添加了范圍 styles。 我想做的是將所有通過情感添加到特定選擇器的 styles 限制。 我正在尋找的 SCSS 等價物是這樣的,其中 sty ...
[英]@emotion/styled with esbuild - import_styled11.default.div is not a function
我目前正在嘗試使用 esbuild、react 和emotion/MUI 構建一個站點。 一切都很順利,除了最后一個障礙是從@emotion/styled中獲取樣式化組件。 uncaught TypeError: import_styled11.default.div is not a funct ...
[英]Storybook vite failed to build with ChakraUI / React 18
我正在使用 Vite 和 Storybook 創建一個 UI 庫。 可悲的是,故事書的構建被破壞了。 在開發模式下,我在構建過程中遇到了一些錯誤,但無論如何我都可以瀏覽故事書組件。 但是生產構建完全失敗並出現相同的錯誤。 這是錯誤:ERROR in ./node_modules/@chakra-ui ...
[英]Emotion Styled conditionally add snippet of styles
我有一個styled組件:const StyledBox = styled(Box)(({theme, locked}) => ({ width: theme.spacing(2.5), height: `calc(50% - 12px)`, borderColor: ...
[英]Styled components: cannot find name 'ref' when trying to pass a ref
我正在嘗試傳遞要在emotion組件內部讀取的引用(類似於styled-components) 但是收到錯誤Cannot find name 'ref' 為了能夠訪問情感組件中的 ref,我應該怎么做? ...
[英]Can't use Component Selectors with MUI v5 Emotion Library
import { Box, styled } from "@mui/material" import { Body1 } from "elements/Typography" export const ItemHeader = styled(Box)` display: flex; flex ...
[英]Adding a property to an input element with TypeScript
我創建了一個帶有情緒反應的輸入元素,該輸入元素有一個名為指針的自定義屬性: 輸入字段 object: TS 抱怨輸入元素上不存在pointer 。 我正在嘗試為其添加一個界面,如下所示: 然后賦值給InputField創建object: 然后 TS 抱怨樣式 object 中缺少屬性指針,並且還抱 ...
[英]String interpolation in Styled components breaks linter
在樣式化組件中插入“主題”變量或任何類型的字符串插入會破壞 linter 流程,我可以再格式化 css。 關於如何解決它的任何想法? linter 打破了格式化的界限,這會產生問題。 謝謝 ...