I've tried a couple different subthemes, both using drush sns and manually duplicating files from the subtheme folder. No matter what I do, the theme refuses to use my grid settings. Instead, it's using the !defaults from sasson/sass/salsa/sass/_settings.scss ($columns: 16 && $gutter-width: 20px).

I've changed settings in admin and in subtheme.info, and tried overriding the variables in either subtheme.scss or in a partial. No dice. I've tried changing the variable globally, and locally within a specific class. Nope.

So far, the only thing that has worked is if I edit the original _settings.scss with different variables.

Looks like the main sasson theme is doing this too. Just checked my theme settings, and it's ignoring them. Not that it should matter, but I'm trying to get it to go 19 columns and 0 gutter.

I'm running version = "7.x-3.x-dev"
core = "7.x"
project = "sasson"
datestamp = "1351690423"

Comments

tsi’s picture

Status: Active » Postponed (maintainer needs more info)

So far, the only thing that has worked is if I edit the original _settings.scss with different variables.

So your Sass is being re-compiled to CSS - your custom styles work properly and it is only the grid settings, right ?

Just to be clear, are you using Sasson's built-in compiler ? you're not compiling with compass watch or any app that does it ?

superjerms’s picture

Correct. I've got compass installed on the server, but sasson is triggering it to compile.

SASS SETTINGS:
"compile sass to css" & "development mode" are on
"compiled files path" & "url helpers" aren't set
"debugging" is on

DEVELOPMENT:
"File watcher" & "update styles without refreshing" are off (these froze up my server...4.6ghz & 1.6GB ram, had my server load up at the 11-12 range.
"files to watch" points to my subtheme.scss, but not any of my partials
I'm just resaving and clearing caches as needed.

Now that i'm messing around with some stuff, I am noticing that I can override the vars from within my partial; it's just not updating the grid overlay (but it's not pulling from my .info or admin>appearance>settings>subtheme>grid settings)

superjerms’s picture

just for fun, here's the .info settings it's ignoring...

; Theme Settings ----------------------------------------------------------
; these are the defaults for the theme settings configuration.
; sub-themes must re-declare default settings.

settings[sasson_show_grid] = 1
settings[sasson_grid_width] = '960px'
settings[sasson_columns] = 19
settings[sasson_gutter_width] = 0
settings[sasson_sidebar_first] = 0
settings[sasson_sidebar_second] = 6

settings[sasson_responsive] = 1
settings[sasson_responsive_approach] = 'desktop_first'
settings[sasson_responsive_narrow] = '960px'
settings[sasson_responsive_narrower] = '767px'
settings[sasson_responsive_narrowest] = '480px'
settings[sasson_responsive_mf_small] = '480px'
settings[sasson_responsive_mf_medium] = '767px'
settings[sasson_responsive_mf_large] = '960px'
settings[sasson_responsive_menus_width] = '480px'
settings[sasson_responsive_menus_selectors] = 'ul#main-menu-links, ul#secondary-menu-links'
settings[sasson_responsive_menus_autohide] = 1

settings[sasson_sass] = 1
settings[sasson_devel] = 1
settings[sasson_compiler_destination] = ''
settings[sasson_images_path] = ''
settings[sasson_fonts_path] = ''
settings[sasson_sass_recompile] = 1

settings[sasson_cssreset] = 'normalize'
settings[sasson_formalize] = 1

settings[sasson_js_footer] = 0
settings[sasson_latest_jquery] = 0
settings[sasson_disable_sassson_js] = 0

settings[sasson_force_ie] = 1
settings[sasson_html5shiv] = 1
settings[sasson_ie_comments] = 1
settings[sasson_prompt_cf] = 'IE 6'

settings[sasson_font] = ''
settings[sasson_font_fallback] = 'sans-serif'
settings[sasson_font_selectors] = 'body'

settings[sasson_watcher] = 0
settings[sasson_watch_file] = 'sites/all/themes/hlr_sasson/styles/hlr_sasson.scss'
settings[sasson_instant_watcher] = 0
settings[sasson_mail_to_file] = 0
settings[sasson_mail_to_log] = 0
settings[sasson_mail_devel] = 0
settings[sasson_mail_prevent] = 0
settings[sasson_overlay] = 0
settings[sasson_overlay_url] = 'hlr-home.jpg'
settings[sasson_overlay_opacity] = 0.4

settings[sasson_breadcrumb_hideonlyfront] = 1
settings[sasson_breadcrumb_showtitle] = 1
settings[sasson_breadcrumb_separator] = '::'
settings[sasson_feed_icons] = 0
tsi’s picture

Thanks for all the info,
So, about your settings, nothing special here. you should have "debugging" turned on only on extreme cases where you are testing the compiler (and now we are, but don't forget to turn it off) this might also be related to the fact that the file watcher choked your server though I'm not sure why. all in all your settings sound good.
About the .info file - well, those theme settings are just the default settings, you can change them before you enable the theme but once you did - those go into the DB and changes in the file will be ignored.
But I still can't see why changes in your theme settings form are ignored...
What OS are you on ? what version of compass ? did you get your custom styles, other than the layout, to compile ?
let's try a small test, put this anywhere inside one of your Sass files (main stylesheet, not a partial) :

body:before {
  background: orange;
  display: block;
  padding: 20px;
  content: "You have [columns] columns"
}

This token should be replaced by Sasson to show the number of columns.

For the record, you could work around this by copying layout.scss from Sasson into your sub-theme and call it from your info file, this will disable the original layout.scss and allow you to set via code all the grid settings without hacking anything. but this way we won't find what caused the issue :)

superjerms’s picture

I'm running Compass 0.12.2, but having sasson trigger all compiling. I'm on CentOS 5.6 (Linux version 2.6.18-238.9.1.el5xen (Red Hat 4.1.2-50)).

And, sass/compass has been compiling all along (I'm just using debug to make things compile because the watcher is causing the server to go crazy, and the overhead is comparably negligible). Even salsa settings are correct, except that it's basing everything off the wrong [column], [gutter-width], and i'm guessing sidebar settings.

With your code, the token outputs the correct value, but the background grid is still wrong. More important to me, though, is that the body is still rendering with 16 columns unless I override the token from within my sheet. Stuff I've tried (none of which has worked):

  • Created an unchanged drush sns subtheme, changing the grid setting (in the DB) and nothing else.
  • Created a drush sns subtheme, customizing the defaults in subtheme.info and leaving the DB alone.
  • Set the grid layout of individual theme elements, using the base subtheme.scss only.
  • Set the grid layout of individual theme elements, using an "@import partials/layout.sass" in my subtheme.scss sheet.

My goal is to do things that last way (settings via DB, layout via included _layout.sass). But to summarize, sasson is seeing the right token, but is ignoring it for both the theme and the background. If I override the vars from within my subtheme sheets, it'll fix the theme, but not the background.

tsi’s picture

You have one more option - creating a sub-theme without enabling it, editing the .info file with your layout settings and only then enabling it.
Other than that, I'm really out of ideas, this has never happened to anyone I know of.
Are you working on a fresh drupal install ? is there any other module that can interfere with the theme ?
Did you ever tried Sasson 2.x ? did you have similar issues with the php compiler ?

With the info available, I can only suggest workarounds -
Did you try putting a copy of layout.scss from the parent into your theme and .info file ? this will give you control over the layout settings.
Right below that, you can call something like :

#page {
  @include salsa-background;
}

This should add the grid background using the values you've set above it.

tsi’s picture

Just read again your last comment, you shouldn't need the "debug" mode to have compass re-compiling your files, they should compile whenever they are modified (on page refresh).
The file watcher makes it so you wouldn't even have to refresh your page, Sass is being re-compiled and CSS is refreshed in the browser without a page refresh.
"Debug" mode forces all Sass files to re-compile even if they hadn't been modified.
BTW when in dev mode, you can also use Ctrl+C to re-compile all stylesheets or Ctrl+P to re-compile for production (minified CSS).
Hope that clears up the situation.

superjerms’s picture

Actually tried the "defaults via .info" route already (second bullet above).

I had been on 2.6, and it wasn't having issues like this, but it was really choking on compass commands. I could always try 2.7, but is there a way to force sasson to use compass instead of phamlp? I thought I vaguely recalled something, but couldn't find anything when I was looking around after moving to the new server.

I'm using workarounds right now, but wanted to loop you in. I'm really liking Sasson, and hope to contribute in whatever way I can :)

erutan’s picture

I used the ruby compiler when working locally, I'd just sass-watch the folder in my subtheme and uncheck the compile settings in the theme UI on the server. If you want to use a full compass install you could just create a new compass project in that folder and tweak the config.rb if/as needed.

tsi’s picture

@erutan, this is about v3.x where you don't need to manually watch the files since Sasson is compiling using the original ruby compiler (and Assetic).

erutan’s picture

The post above mine mentioned using 2.6 and wanting to try out 2.7 using out the ruby compiler, so my comment addressed that. :)

tsi’s picture

Please try again with the latest 7.x-3.x-dev (wait for it to update, shouldn't take more than 12h), there was a big change in this commit - I hope it won't break anything you already did.

superjerms’s picture

Sorry about the long delay. Those changes in the last update nuked the old theme, and I didn't get a chance to start a new one till now.

I'm working from a fresh install, in a different environment than before (on my mac, MAMP, D7.18, latest sasson3x dev). I've got a bunch of modules, but none of them are enabled. It's pretty much stock, other than disabling core color/toolbar/shortcut/update_manager/comment and enabling admin_menu and module_filter.

For testing, I'm configuring variables ($gutter-width: 20px; $columns: 24; $sidebar-first: 2; $sidebar-second: 5) in the mytheme/sass/mytheme.scss and verifying the changes using a variation of your earlier code:
body:before {
background: orange;
display: block;
padding: 20px;
content: "Total columns: #{$columns}. 1st Sidebar: #{$sidebar-first}. 2nd Sidebar: #{$sidebar-second} col."
}
That SCSS returns the correct subtheme values.

With all of that in place, there are still problems.

As before, the grid that is turned on through admin (appearance>sasson-subtheme>settings>development) is stuck on the salsa default settings, and ignores subtheme variables. Also as before, I can manually create a grid using @include salsa-background in my subtheme, and it has the correct gutters/columns/widths.

Another (new) problem: no matter what I do, the grid renders the sidebars incorrectly. The SCSS I posted above does output the correct values for $sidebar-first and $sidebar-second, but the sidebars themselves are still pulling their settings from the base Sasson settings (inspecting in FireSASS, the sidebars are 25% wide, from sasson-base.scss - line 34).

If I redeclare the @include grid($sidebar-first, 0) from within my subtheme.scss, it works.

So, to summarize, all of the base Sasson SCSS is ignoring (or probably, rendering before) any variable updates I have made within the subtheme SCSS.

superjerms’s picture

Ok, figured it out. I was trying to override the variables in my subtheme.scss instead of making a duplicate of ../sasson/sass/salsa/sass/_settings.scss

For what it's worth... between my overrides not working, and the fact that there's two _settings.scss (one in the root sasson's base sass folder and the other in the salsa's sass folder), it might be a bit confusing to other people than just me.

If nothing else, you might include a _settings.scss in the SUBTHEME folder, to make it obvious that people need to update the setting.

tsi’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Needs work

Thank you, a settings file in the sub-theme makes perfect sense ,I'll add that. If you can think of anything else that might make that more clear please share...

superjerms’s picture

Category: support » bug

On further review, I think there's an actual bug here.

  1. Copy sites/all/themes/sasson/sass/_settings.scss to sites/all/themes/subtheme/sass/. Change the columns to 32, and the sidebar-second to 10.
  2. Add an reference in sites/all/themes/subtheme/sass/subtheme.scss
      @import "partials/test";
    
  3. Create sites/all/themes/subtheme/sass/partials/_test.sass (note, that's a sass file, not compass). Call any variable that you've defined in your subtheme copy of _settings.scss :
    body:before
      width: 100%
      background: orange
      color: white
      display: block
      padding: 30px 10px
      content: "I defined 32 columns, but the partial only sees #{$columns}" 
      content: "My sidebar is defined as 10 col, but throw an error instead. #{$sidebar-second}"
    
  4. The page will render 16 in the first css, and throw an Assetic error for the second:
    error assetic_compass7X9pVy.scss (Line 9 of sites/all/themes/subtheme/sass/partials/_test.sass: Undefined variable: "$sidebar-second".)
    

Your css will only outputs !default values (defined in sites/all/themes/sasson/sass/salsa/sass/_settings.scss), instead of sasson's or your subtheme's overrides. Note that the salsa settings file does not define sidebars, which is where the error is coming from.

Bug?

superjerms’s picture

One other thing, while I'm still thinking about the whole partials thing. You mentioned earlier that debug shouldn't be necessary for the page refreshes. My question would be, does Assetic compile a production css file if I update a partial, but don't touch the subtheme.scss? It seems as though my "partials" changes only show up if I resave the subtheme.scss

For example:

  • I created _test.sass in my subtheme/sass/partials folder, add some code, and save. Good so far.
  • I add @import "partials/test" to subtheme.scss and save. Sasson updates as expected.
  • I add some new code in partials/_test.sass saving several times. Nothing changes on the site.
  • I resave subtheme.scss, and now my changes in partials/_test.sass show up.
  • I can work on _test.sass for an hour, saving 40 times, but the site won't update...page refreshes and watcher has no effect until subtheme.scss gets resaved.

I dunno if this all is a bug or intended behavior, but that's why I had debug on. It forces Sasson to re-examine subtheme.scss even if I haven't saved it (e.g. i only saved partials/_test.sass). Obviously, I can't do that once the site is in production, but it's faster than resaving subtheme.scss repeatedly.

tsi’s picture

Your touching two different issues:
#16 - if you didn't @import "settings" into subtheme.scss before importing _test.sass, then you shouldn't expect to have the settings available to you in your test partial. that is expected and if that is the case, then no issue here.
#17 - that is a real issue, Sasson can only check the last modified date of the file it is currently compiling, it doesn't know of the imported partial and if they have been modified, so it doesn't recompile your subtheme.scss until you save it again. I don't have a real solution for this problem but we do have a nice work-around - when pressing ctrl+c in your browser your sass files will be re-compiled, or you can even use Ctrl+p and compile for production (output minified CSS with no debug info), I use that before pushing to production. anyway, using the debug option is an overkill since it will re-compile everything, always, no matter what you were working on.

superjerms’s picture

#16 - I happened to figure that out on my own a couple hours after posting last night. I hadn't been importing _settings.scss at all, just assumed that it'd be found on its own. A quick solution there could be to mention settings in the comment on line 28 of SUBTHEME.SCSS, such as:

  // @import "compass/css3";      // Uncomment to use CSS3 mixins (http://compass-style.org/reference/compass/css3/)
  // @import "salsa/salsa";       // Uncomment to use layout mixins (see Sasson's layout partials for examples)
     // @import "settings";       // Change the default salsa settings and breakpoints (copy _settings.scss to your sass folder)
  // @import "partials/mixins";   // Uncomment to call your own mixins partial (check your /partials directory)

#17 - True, but alt-c/alt-p don't trigger a page css refresh (even though they do trigger the success message). I assumed this was by design? I guess a helpful addition would be to make those shortcuts also trigger a full page refresh.

Debug is overkill; I was just saving myself a keystroke by using it to force the refresh. Sure, it'd make for a long day if I have several users at once making page requests on a production site, but it saves me a step in my local environment and staging server.

tsi’s picture

Sure, alt-c/alt-p should re-compile your sass files *and* refresh your browser window, I never had issues with it, open a new issue if that doesn't work as expected.
Another alternative to the 'debug' checkbox is adding a line to your .info file, it will cause that specific file to always recompile as opposed to the checkbox forcing *all* your files to recompile:
styles[sass/filename.scss][options][recompile] = true

erutan’s picture

#19 - +1 for including that @import for _settings.scsss.

I'm running a dev site on v3.x now and I'm getting some compiling errors I'm going to toss up a new issue for.

tsi’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Cleaning up.
So much have changed lately in the 3.x branch that this issue is probably irrelevant.
You are welcome to try the latest v3.x

cyxair’s picture

comment moved