动态设置悬停颜色
我正在使用Drupal,并创建了一个颜色字段,用于在变量中使用以不同的内容,其中有一个转储的示例:
我在树枝中的内容上使用它这样:
<p style="{{ node_color ? 'color:' ~ node_color }}">{{ content.field_formated_title.0 }}</p>
现在我想在悬停按钮上使用这种颜色,但是我真的不知道该怎么做,我应该在我的CSS还是JS?
I'm using drupal and I created a color field to be used in variable to make contents with differents color, there is an example of a dump :
and I use it like this on my content in twig :
<p style="{{ node_color ? 'color:' ~ node_color }}">{{ content.field_formated_title.0 }}</p>
Now I want to use this color on hover buttons, but I don't really know how to do that, should I do something in my css or js?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
普通CSS是用于样式的,因此我会编写自定义CSS文件并在那里写悬停CS。
抱歉,我不知道您的方式是否有命令 - 找不到任何东西。
Normaly css is for style, so i would write custom css-file and write hover-css there.
Sorry, i do not know whether there is a command for your way - did not found anything.