Hello,
I may be off topic, but please accept my apologies, I need help :
I use Bulma with Laravel. Laravel-elixir is a gulp wrapper which pack every useful assets together.
So basically, I use sass and webpack under the hood.
I have a lot of fun while using Bulma as Bootstrap replacement but now I'm stuck because I try to use a responsive mixin in my scss file.
Could someone can show me my error, and maybe a way to use mixins from my scss file ?
I'm trying to apply a translation on one of my div but I can't figure out what is the correct syntax.
From my app.scss, I've tried
@import 'bulma/bulma';
@import 'bulma/sass/utilities/mixins';
(...)
.is-custom {
=desktop
transform: translateX(-60%);
&h2 {
text-transform: uppercase;
}
}
But I got the error below.
I also tried a lot of (blinded) alternatives, but non worked :
=desktop {
transform: translateX(-60%);
}
@include =desktop {
transform: translateX(-60%);
}
@include =desktop(transform: translateX(-60%);)
+desktop({transform: translateX(-60%);})
@include desktop({transform: translateX(-60%)});
I'd expect a desktop' media query computed with my transform definition
Here is the error message I got
[18:03:00] Starting 'sass'...
{ Error: resources/assets/sass/app.scss
Error: Invalid CSS after " .is-custom {": expected "}", was "=desktop"
on line 44 of resources/assets/sass/app.scss
>> .is-floating {
----------------^
at options.error (/Users/loranger/Developer/myproject/node_modules/node-sass/lib/index.js:292:26)
status: 1,
file: '/Users/loranger/Developer/myproject/resources/assets/sass/app.scss',
line: 44,
column: 17,
message: 'resources/assets/sass/app.scss\nError: Invalid CSS after " .is-custom {": expected "}", was "=desktop"\n on line 44 of resources/assets/sass/app.scss\n>> .is-custom {\n ----------------^\n',
formatted: 'Error: Invalid CSS after " .is-custom {": expected "}", was "=desktop"\n on line 44 of resources/assets/sass/app.scss\n>> .is-custom {\n ----------------^\n',
messageFormatted: '\u001b[4mresources/assets/sass/app.scss\u001b[24m\nError: Invalid CSS after " .is-custom {": expected "}", was "=desktop"\n on line 44 of resources/assets/sass/app.scss\n>> .is-custom {\n ----------------^\n',
messageOriginal: 'Invalid CSS after " .is-custom {": expected "}", was "=desktop"',
relativePath: 'resources/assets/sass/app.scss',
name: 'Error',
stack: 'Error: resources/assets/sass/app.scss\nError: Invalid CSS after " .is-custom {": expected "}", was "=desktop"\n on line 44 of resources/assets/sass/app.scss\n>> .is-custom {\n ----------------^\n\n at options.error (/Users/loranger/Developer/myproject/node_modules/node-sass/lib/index.js:292:26)',
showStack: false,
showProperties: true,
plugin: 'gulp-sass' }
Please ?
Any clue ? Any advice or tutorial, maybe ?
You are mixing .sass and .scss syntax
http://sass-lang.com/guide
in sass it should be
+desktop
color: red
in scss
@include desktop {
color: red;
}
but i am not sure you can import sass mixins into scss
That's exactly my issue, thank you so much !
I owe you a hug, @givehug ;)
what did you do? you rewrite everything?
No, I don't.
I simply use bulma from sources in my project and create some new classes in order to fit my needs. But I needed my new classes to be as responsive as possible, and instead of rewriting media-queries, I'd prefered to use existing mixins.
Now it works like a charm :p
Most helpful comment
You are mixing .sass and .scss syntax
http://sass-lang.com/guide
in sass it should be
+desktop
color: red
in scss
@include desktop {
color: red;
}
but i am not sure you can import sass mixins into scss