PDA

View Full Version : Can I import existing SCSS in Sencha Themer



maheswari
11 Jul 2017, 5:23 AM
Hello,
Is it possible to import/reuse scss classes in Sencha Themer when creating a custom theme? I am trying to convert some existing stylesheets to a ExtJS compatible theme using Sencha Themer and wondering if the old files could be of any help.

Thanks.

dan.buhrman
19 Jul 2017, 10:10 AM
Hello, sorry for the delayed reply. :(

Yes, you can absolutely do this, however, Themer itself provides no mechanism to easily 'import' SCSS/CSS.

tl/dr; Themer simply generates a standard Sencha Package, so you can do normal package things manually, and Themer will continue to function

You can read about theming here: https://docs.sencha.com/extjs/6.5.0/guides/core_concepts/theming.html#core_concepts-_-theming_-_the_theme_api

If you did not follow the best practices guide on structuring your SCSS files, that's OK too. You can put your SCSS/CSS files inside of the correct SASS folder (read guide to know differences between the three folders, but basically Cmd imports fils in this order: etc -> src -> var). Then, add an entry in package.json to reference your file.

The is one gotcha if you have changed variables in your custom SCSS files: Themer will not know about them. This means those variables will not have the revert (x) button next to the variable to 'revert' it back to the base theme's default value. This hopefully isn't a huge deal, but if you do care, you can find and move all of your variable assignments into save.scss file, and Themer will pick them up and make them 'revertable'.

Hope this helps and I'm not too late!