EasyUI Forum

General Category => EasyUI for React => Topic started by: spider58 on December 04, 2018, 05:41:10 AM



Title: Cannot Apply Theme in react
Post by: spider58 on December 04, 2018, 05:41:10 AM
Hi,

Code:
@import 'easyui/themes/default/easyui.css';
@import 'easyui/themes/icon.css';
@import 'easyui/themes/react.css';


Is there any thing to do for theme define? because  i can't see themed objects


Title: Re: Cannot Apply Theme in react
Post by: jarry on December 04, 2018, 06:47:24 AM
Try this code instead.
Code:
@import '~rc-easyui/dist/themes/default/easyui.css';
@import '~rc-easyui/dist/themes/icon.css';
@import '~rc-easyui/dist/themes/react.css';


Title: Re: Cannot Apply Theme in react
Post by: spider58 on December 04, 2018, 07:15:22 AM
Try this code instead.
Code:
@import '~rc-easyui/dist/themes/default/easyui.css';
@import '~rc-easyui/dist/themes/icon.css';
@import '~rc-easyui/dist/themes/react.css';

Doesn't worked.

my.main.css is in css folder. This is my folder structure. I seeing css files loaded without any problem with my codes (at F12 developer tools). But can't apply theme.


dist
     css
          easyui
              themes
              .
              .
              .
           my.main.css
index.html


Title: Re: Cannot Apply Theme in react
Post by: jarry on December 04, 2018, 07:12:25 PM
After install the 'rc-easyui', the package will be installed in 'node_modules/rc-easyui' directory. You can put this lines to the 'index.css' file that is in your project.
Code:
@import '~rc-easyui/dist/themes/material-teal/easyui.css';
@import '~rc-easyui/dist/themes/icon.css';
@import '~rc-easyui/dist/themes/react.css';

And then import the 'index.css' file in your 'index.js'.
Code:
import './index.css';


Title: Re: Cannot Apply Theme in react
Post by: spider58 on December 04, 2018, 11:26:08 PM
After install the 'rc-easyui', the package will be installed in 'node_modules/rc-easyui' directory. You can put this lines to the 'index.css' file that is in your project.
Code:
@import '~rc-easyui/dist/themes/material-teal/easyui.css';
@import '~rc-easyui/dist/themes/icon.css';
@import '~rc-easyui/dist/themes/react.css';

And then import the 'index.css' file in your 'index.js'.
Code:
import './index.css';

thanks. i tried it but getting invalid character "@" error. I think something wrong with my webpack.