问题标签 [radium]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
41 浏览

reactjs - How can I used Radium in react js

I'm trying to give style using radium react js, and it don't work

this's Nav.css

this is nav.js

this's app.js

so, I want to do a nav responsive, so when @media screen and (maxWidth: 700px), nav is going to hide automatically, so when se media screen is greater than 700px, nav is working perfectly but less than 700px nav is not hideen, so I think that this const StyleCompleted = { '@media screen and (maxWidth: 700px)':{.....} } is not working, whue?

0 投票
0 回答
10 浏览

reactjs - 错误:要使用需要 `addCSS` 的插件(例如关键帧、媒体查询),请将您的应用程序包装在 StyleRoot 中

在这里,我的代码 app.js 将整个 jsx 包装到 StyleRoot。我不知道问题出在哪里。

我没有发现错误。请帮助我。

0 投票
1 回答
36 浏览

reactjs - 无法使用 npm 命令安装 Radium

我使用了 npm install --save radium 命令,我得到了这个作为回报如何解决这个问题?

在此处输入图像描述

0 投票
1 回答
358 浏览

reactjs - radium install Error while using with react 17.0.2

When I am trying to install radium with npm, I am getting a dependency tree error.

Command I am using:

#xA;

Here is the error stack I am getting -

#xA;

I do not wish to force downgrade my react version to 16.8.0. How can I resolve this?

0 投票
0 回答
20 浏览

reactjs - 与 Radium 反应的媒体查询不起作用

我最近开始学习 React,现在我正在尝试使用 Radium JS 库创建一个媒体查询,但由于某种原因,它似乎没有在应用程序中应用。我试图在变量中重现的 CSS 代码是:

我尝试这样做的方式如下:

不得不提的是,我已经将返回的JSX 代码包装在App.js中的<StyleRoot></StyleRoot>元素中,该元素已在那里导入。

我在这里想念什么?

0 投票
0 回答
8 浏览

javascript - React Radium Library CSS:悬停选择器更改先前选择的随机基本文本颜色

我正在开发一个个人网站,其中包含随机样式的标题文本。它目前只是随机化字体和颜色(尽管我计划添加更多),我通过从预定义的字符串列表中选择一个值来实现这一点。由于随机化需要在 JavaScript 中进行,所有样式都是通过 React 内联样式(在一个名为 StyleObj 的 const 中)完成的。为了进一步自定义我的文本,我安装了 Radium 库,它允许我使用 CSS :hover 选择器。我的问题来自这样一个事实,显然, :hover 选择器是以某种方式实现的,它强制重新编译我的 StyleObj 并因此重新绘制随机字体和颜色。

另外,呃,颜色和字体是临时的。哈哈