In my component's scss file, I am trying to use other scss files.
I thus wrote the following as the first statements in my component's scss file (before anything else):
#use './_one.scss';
#use './_two.scss';
However, when I run the dev server, I get a very confusing error:
[ ERROR ] sass error: src/components/my_component/my_component.scss:1:86
#use rules must be written before any other rules.
L1: #use '_one.scss';
L2: #use '_two.scss';
Also worth mentioning: _one.scss and _two.scss both use _common.scss and have the following as first statement:
#use './_common.scss'
commenting this out in _one.scss and _two.scss doesn't change anything.
Is this a known incompatibility between sass and stenciljs? I tried to search for answers but to no avail. What am I missing here?
Help appreciated. Thanks!
Related
Currently, I've got Prettier set up through ESLint using the following .eslintrc.json:
{
"extends": ["react-app", "plugin:prettier/recommended"]
}
This works fine for linting and formatting JavaScript files.
However, when I'm trying to run ESLint (and thus Prettier) on Markdown and CSS files, errors like the following occur:
/Users/willem-aart/Code/foo/bar.md
1:1 error Parsing error: Unexpected character '#'
> 1 | ## foobar
| ^
✖ 1 problem (1 error, 0 warnings)
It seems that ESLint cannot handle the file. On the other hand, Prettier – when run standalone – handles the file as expected.
Is it possible to format files other than JavaScript using Prettier through ESLint? Or am I better off using Prettier standalone?
I guess Prettier can be applied to a broader range of file formats than ESLint is intended for.
While trying to use grunt to convert my sass files into normal css files i get the warning:
Warning: Encoding::CompabilityError: incompatible character encodings: UTF-8 and CP850.
However when I run sass calling the file(s) everything works as it should even though no encoding is specified by me. My Gruntfile.js looks like this:
[...]
sass: {
main: {
files: {
'css/theme/default.css': 'css/theme/source/default.scss',
'css/theme/beige.css': 'css/theme/source/beige.scss',
'css/theme/night.css': 'css/theme/source/night.scss',
'css/theme/serif.css': 'css/theme/source/serif.scss',
'css/theme/simple.css': 'css/theme/source/simple.scss',
'css/theme/sky.css': 'css/theme/source/sky.scss',
'css/theme/moon.css': 'css/theme/source/moon.scss',
'css/theme/solarized.css': 'css/theme/source/solarized.scss',
}
}
}
[...]
which is a part of the Gruntfile.js I forked from the reveal.js on GitHub. I took a look at the grunt-contrib-sass on GitHub and tried to find the option to change the encoding manualy. However it apears that there is none (maybe I just overlooked it?).
I think a keypart of the problem is that I am using Windows 8 and not any Unix based OS.
So my question is:
How do i get rid of this warning? Or how do i fix the code to work properly?
Any help is appreciated.
I had this error when trying to use the command:
sass --watch global.scss:global.css --style compressed
And the cause was the most stupid cause ever... I had this folder: E:\Dropbox[Websites][External] Fundación Global\css and I run the command in there, and SASS returned this same error: Warning: Encoding::CompabilityError: incompatible character encodings: UTF-8 and CP850.
I just needed to take out the ó from the folder's path!
That simple and silly! Just changed this: ...Fundación Global\css for this ...Fundacion Global\css and I have SASS watching with no issues again.
I am working with really big projects which are using compass(compass sprites tools including) sass framework cli tool(compass watch, compass compile) to create app.css file. Sass of the project is using multiple #import statements to include dozens on sass partials.
Problem is that app.css file is compiling for more than 2 minutes(app.css is 70000 lines long) after each small change in any sass partial imported into app.scss file compiling all of them at once while I need only 1 line change.
I made an extensive research and found articles like this one http://blog.teamtreehouse.com/tale-front-end-sanity-beware-sass-import which is suggesting to use spockets instead of #import to include sass partials. I like the solution more than most but big refactor will be needed even to test if it will work also all global includes like mixins and variables will need to be included in each sass partial used in the project which is also not ideal.
After some more research I have found this https://github.com/petebrowne/sprockets-sass tool which should automatically transform #imports into spockets require statements for compiler and also preserve ability of global imports.
The problem is I don't know ruby and did not use anything ruby related else then "gem install" statement )))
Can someone who knows ruby help me by explaining step by step how to make compass compiler work with sprockets-sass ?
P.S Please do not suggest solutions like libsass and it's like I have tested it by excluding all compass sprite related stuff and libsass also take a bunch of time to compile 40000 lines that remained without sprites(I suspect that part of the problem is not in compilation speed but in time system needs to create 400000 line file after).
The only thing that you can do is to split the output top-level file (app.css) into multiple output top-level files, and at the end of the compass-compilation reconcat them with a sprockets task!
This optimizes the usage of sass cache and the final concat-task is efficient because is a simple concatenation!
By the way, at the moment, compass is replaced with the EyeGlass Project made by Chris Eppstein the author of Compass.
So Consider the idea of a whole refactoring using (grunt/gulp) with libsass (A sass compiler built in C/C++) and EyeGlass that adds all compass-like features to sass!
hope Helps!
I'm am using DotLess v1.4 and I would like to do the following:
// Variables
#Utilities-path: "../../Utilities";
#import "#{Utilities-path}/bacon.less";
When I do this I get a file not found error.
File Not Found while parsing: You are importing a file ending in .less that cannot be found.
If I do this it works correctly.
#import url('../../Utilities/bacon.less');
As far as I'm aware this was added to Less in version 1.4, so I assumed it would work in the latest version of DotLess.
Does anyone know if this feature is available and if so what I am doing wrong?
This is feature is not available in DotLess v1.4. Version 1.4 does not mean that is using the equivalent version of LESS.
According to: https://github.com/less/less.js/issues/410#issuecomment-16219936 it looks like this feature was added in less v1.4.0 and requires the use of a mixin to do the import.
#Utilities-path: "../../Utilities";
.bacon(){
#import "#{Utilities-path}/bacon.less";
}
.bacon();
I am currently using Sublime Text with LESS.build package to compile my .less files into CSS.
My current LESS.build cmd is:
"cmd": ["lessc", "screen.less", "${file_path}/screen.css", "--verbose"]
I tried to add some extra folders to the --include-path:
"cmd": [
"lessc",
"screen.less",
"${file_path}/screen.css",
"--verbose",
"--include-path='.:/var/www/whatever/'"
]
But, whenever i try to build my .less files the --include-path params seems to be ignored.
The only workaround i found is adding the full relative path on my #import:
#import "../../../www/whatver/config.less"; //Ugly solution
Can anyone point me where i am failing and/or any other workaround prettier than mine's?
Looks like there was a bug out for this. https://github.com/cowboyd/less.rb/issues/13
and there was a similar issue here LESS #import: Passing paths to lessc.