Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
315 views
in Technique[技术] by (71.8m points)

reactjs - Semantic-ui-react theming to customise components background colour does not work

I'm trying to customise the semantic-ui components for a react-js project to change colour of a login button to be a hex colour code that I need (not the semantic-ui default colour). I followed with the guide on their main website https://react.semantic-ui.com/theming/

I followed the same way this guide instructed. However, the components that I used to import from semantic-ui-react stopped having semantic-ui style,

import { Button, Form, Grid, Header, Icon, Image, Message, Segment } from 'semantic-ui-react';
...

 <Button icon floated='right' labelPosition='right' color='red' type='submit' disabled={submitting} loading={submitting}>
                                            Login
                                                <Icon name='sign in'/>
...

I'm relatively new to semantic-ui and react-js but I have looked at all places and they explained in different ways or there methods don't work for me.

Edit:

Actually even though I tried to run npm run craco build, it still didn't really override the variables / elements such as buttons, left navigation bar so the only way I worked around this was to actually override the CSS element directly. Still looking for the theming solution though


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...