View Full Version : [FIXED] sencha generate theme creating config.rb with wrong css_path?

1 Oct 2012, 7:07 PM
I wanted to play with a custom theme so I followed the instructions here...


...to create a new theme in my generated application.

When I do the 'compass compile' command it works but the resulting app.css is incorrectly located.
Its ended up in "myapp/resources/sass/css/app.css" rather than "myapp/resources/css/mynewtheme/app.css".

Looking at the config.rb in the theme I created I can see the problem...

# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
$ext_path = File.join(dir, '..', '..', '..', 'ext')

# Load the extjs framework automatically.
load File.join($ext_path, 'resources', 'themes')

# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css") # << This is what was generated and puts the output in the wrong location
# This works >> css_path = File.join(dir, "..", "..", "css", "mynewtheme")

# Require any additional compass plugins here.
images_dir = File.join(dir, "..", "images")
output_style = :compressed
environment = :production

I'm testing this by loading the generated theme.html file in to my browser.
e.g. file:///Users/hjones/test4/resources/theme/mynewtheme/theme.html

In my app.scss I made the following simple changes...

$theme-name: 'gray';
$base-color: green;

$window-background-color: yellow;

@import 'compass';
@import 'ext4/default/all';

Without the change to the config.rb file I just keep picking up the stock extjs theme.
With the adjusted css_path my modifications show up.

I was expecting the generate theme + compass compile + test to work out of the box, i.e. not require tweaking or file moving.
Does this looks like a 'sencha generate theme' bug on the css_path in the config.rb file?

1 Oct 2012, 11:56 PM
Yes this is a bug. We are tracking this here http://www.sencha.com/forum/showthread.php?243658-Sencha-Cmd-v3.0-CSS-is-overriden-and-erased-bad-relative-reference-to-images

Unless you feel this is a different issue...

2 Oct 2012, 8:58 AM
This report seems to be slightly different from the bug being tracked, but maybe related?

I have just generated a new theme (with Cmd build 181) and can confirm that the generated config.rb file does not have the correct value for 'css_path'.

5 Oct 2012, 10:54 PM
This should be fixed in - http://www.sencha.com/forum/showthread.php?243153-Sencha-Cmd-V3-Beta

8 Oct 2012, 5:38 PM
Yup...looking good in 190. Thanks....big improvement over earlier builds.