Changes to _settings not recognized - css

I've set up the foundation framework for compilation with Compass. Everything works fine except that changes to the _settings file are not compiled to my app.css.
That's my (nearly) original app.scss file:
#import "settings";
#import "custom/settings";
#import "foundation";
If I make changes to the _settings.scss file, Compass shows me the following information:
>>> Compass is polling for changes. Press Ctrl-C to Stop.
>>> Change detected at 10:23:56 to: _settings.scss
identical stylesheets/app.css
Which means it looks like the #import command is recognized but it doesn't lead to any changes in the compiled app.css. And in fact the CSS isn't changed. The "custom/settings" file is imported and compiled to app.css correctly.
Has anybody an idea or hint for me what's going wrong here?

This would appear to be unsupported except if you're using Ruby or similar.
http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import

Related

How can I make #Import function in my main.scss global?

Hey guys I'm a newbie learning sass and I'm using node.js and cmd to serve as my local compiler. I have a main.scss file where I have done all my #imports. This is an image of main.scss with all imports Anytime I try to save my work, I get an error saying my variables are undefined, meanwhile they are.
This is the error.
And this is where the supposed error is. Meanwhile my variable.scss is intact, take a look here
So I guess the question is, how do I make my #imports global in my project.
Double Check your variable $color-primary-light if it is define in your scss file. Or change the #import "base/typography function and transfer it to the upper most part of your main.scss.
Scss reads imports from top to bottom and there are some css specificity/hierarchy of css when compiling them into one css file.
#import "base/typography
#import "base/base
#import "base/animations
#import "base/utilities

sass won't compile, file unreadable or not found

Conversion error: Jekyll::Converters::Sass encountered an error while converti
ng 'assets/css/all.sass':
File to import not found or unreadable: 1-tools/-tools-dir.
on line 1
That is the error i get every time i run Jekyll and i can't seem to fix it. I've tried everything that i found on Google and still can't seem to make it work.
Any idea what is wrong with the includes?
My files are like this:
_-tools-dir.sass
#import 'bourbon/bourbon'
#import 'fonts'
#import 'normalize'
#import 'vars'
_-sections-dir.sass
#import 'header'
all.sass
---
---
#import '1-tools/-tools-dir'
#import '2-base/-base-dir'
#import '3-sections/-sections-dir'
and in base-dir i have no includes yet so the file is empty
With default Jekyll settings, all sass/scss/coffee imports are supposed to be in _sass folder.
Your #import '1-tools/-tools-dir' import rule is looking for _sass/1-tools/-tools-dir.sass file and not _sass/1-tools/_-tools-dir.sass (note the underscrore).
You can change the import to #import '1-tools/_-tools-dir or change the file name to -tools-dir.sass.
Same for other imports that will cause the same not found error.
you're probably doing the YouTube tutorial from DevTips (which is a pretty good one imo).
Add this to your config.yml:
sass:
sass_dir: assets/css
style: :nested

Rails application.css.scss not aware of other scss files in use?

I'm following M Hartl's Rails Tutorial, and trying to add a bootswatch theme.
I have succeeded by using the boostrap-sass gem as defined in the tutorial, and twitter-bootswatch-rails gem from the net.
However, in Hartl's tutorial, all the CSS that we write in addition to default bootstrap is in a separate custom.css.scss file.
My application.css.scss file (Renamed from Rails default .css) contains
#import "bootstrap-sprockets";
// Import cerulean variables
#import "bootswatch/cerulean/variables";
// Then bootstrap itself
#import "bootstrap";
// And finally bootswatch style itself
#import "bootswatch/cerulean/bootswatch";
#import "custom";
Which works, however the custom.css.scss file has a reference to $gray-light, a variable set in bootstrap. The server will return an error at the variable reference in the css file, unless I add
#import "boostrap-sprockets";
#import "bootstrap";
to custom.css.
End result though, is I now have two gigantic CSS files being used, for what I would think is no reason.
I thought the idea of
#import "custom";
was to include my custom.css.scss file into the application.css.scss file so that it would all be in one place, and variables would work nicely.
The other method that works is to dump my entire custom.css.scss contents into application.css.scss but that defeats the point of having separate files.
Am I doing something wrong?
Edit: To add more fuel to the fire, I deleted the two lines from custom.css, and instead `#import bootswatch/cerulean/variables"; and it works. However, the resulting CSS that's on the website itself has NOTHING from that file.
This could well be wrong, but I post an answer to my own question as follows:
It appears that the sprockets lines //= require_self and //= require_tree, even when listed inside the comment section of the manifest as they are by default, are actually running.
This then causes each of the files "required" to be compiled separately. As a result, instead of getting a single application-FINGERPRINT.css file, I was getting an application, a custom, and a static_pages one. I assume this is the "require_tree" line.
After removing these lines, the #import "custom"; line works as I expected it to. The files are all combined into an application-FINGERPRINT.css file and I no longer need to #import anything at the top of custom.scss.

Java FX CSS #import path issue

In Java8_31 I imported different CSS files like that in my main.css:
#import "style/common/test1.css";
#import "style/common/test2.css";
All files were in the package style/common and it worked great.
Now with the build Java8_40 I did the same thing, but I get the following error message:
Could not find stylesheet:
file:/mypath/../style/common/style/common/test2.css
com.sun.javafx.css.parser.CSSParser handleImport
All my styles from the CSS file test1.css are working. What I was curious about was the fact that my path style/common is showing up two times.
So I tried to change my imports to the following:
#import "style/common/test1.css";
#import "test2.css";
With these imports, both styles of the file test1 and the file test2 are working. But both files are still in the same package.
Whats happening here? Is there a known issue about the #import and probably a problem in the CSSParser?
It actually is a known issue:
https://javafx-jira.kenai.com/browse/RT-40346
There is a temporary fix available and the issue should be fixed in the next build Java8_u60.
The temporary fix can be made in the CSSParser class. Link to the git diff:
http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/839912277bf0
If you dont want to try the fix or wait for u60, just add all css files to the same folder and import it like that (temporary solution!):
#import "css/test1.css";
#import "test2.css";
#import "test3.css";
#import "testX.css";
Just contributing to the discussion (not directly to your question):
You don't have to explicitly set the full .css file path. All you need is to specify the .css folder and the file name:
Original path:
#import "css/nodes/path/CssFile.css";
Full path without folder specification:
#import "../../path/CssFile.css";
Both work the same. Notice that, in the second example, "../" refers to the path level, not the specific folder name.
So in your case, that would be
#import "../common/test1.css";

Confusion surrounding #import behaviour in LESS, using Codekit

Currently using Bootstrap, compiling with Codekit, and also have a separate style.less that I'm working on.
In variables.less:
#blue: #0096EF;
In style.less, I have the following:
.title-text {color: #blue;}
#import: "variables.less";
In bootstrap.less:
#import: "style.less";
#import: "variables.less";
Am I doing this right? To my mind, when bootstrap is compiled it results in variables.less occurring twice.
you should be able to go with import of variables.less once in bootstrap as first import instance, and do not include it second time in actual style.less. Because you are right on your assumption, it will import variable.less again. meaning you are importing same variables in two locations.
P.S. as long as variables.less that defines variables that you will be using is imported before you access variables themselves you will be fine.
#color-black: #000;
.color {
color: #color-black;
}
I discovered this is also a Codekit issue too, as I am using Codekit to compile the less files.
Solution:
Create style.less and edit it as intended, reference #blue variable
(not declared in current document)
On save, Codekit returns a compile error, due to un-declared variable in style.less. Ignore the error.
In bootstrap.less #import style.less
Save bootstrap.less, it compiles without issue
Call bootstrap.css in the html doc
Incidentally, I encountered a Codekit bug between step 2 and 3. After step 2, Codekit no longer watches or compiles anything. To solve, I needed to remove the watched project and then re-add it to Codekit.

Resources