Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

@at-root doesn't work #559

Closed
dimitrinicolas opened this issue Dec 4, 2014 · 6 comments
Closed

@at-root doesn't work #559

dimitrinicolas opened this issue Dec 4, 2014 · 6 comments

Comments

@dimitrinicolas
Copy link

dimitrinicolas commented Dec 4, 2014

The function @at-root isn't supported

This feature is really useful especially in order to use this trick : Declaring a CSS Animation @keyframes Directly on an Element using Sass

@mixin animation-keyframes {
  $animation-number: 0 !default !global;
  $animation-number: $animation-number + 1 !global;
  $name: unquote("การเคลื่อนไหวที่-#{$animation-number}");
  animation-name: $name;
  @at-root {
    @keyframes #{$name} {
      @content;
    }
  }
}
@dimitrinicolas
Copy link
Author

dimitrinicolas commented Dec 4, 2014

Oh! I see this feature is already asked on this issues github.com/sass/libsass/issues/353.

I will have to wait

@am11
Copy link
Contributor

am11 commented Dec 5, 2014

Yup, we would have to wait for libsass to bring the support of @at-root.

Lets follow this issue at sass/libsass#353.

@am11 am11 closed this as completed Dec 5, 2014
@sp90
Copy link

sp90 commented Feb 12, 2015

This have been solved in libsass back in start of january, when does it get enabled inside nodesass?

@am11
Copy link
Contributor

am11 commented Feb 12, 2015

@sp90, short answer: in the node-sass release which will be published after LibSass vNext is released.

Summary and gotchas:

node-sass v2.0.x corresponds to LibSass' currently latest v3.1.0.

node-sass always correspond to the tagged release of LibSass, as opposed to a random commit.

To check the versions, you can either do:

node-sass --help

# or, if you have not installed globally
node_modules/.bin/node-sass --help

# or if you prefer io.js
iojs node_modules/node-sass/bin/node-sass --help

# (among other things) it will print something like:
# node-sass version: 2.0.1
# libsass version: 3.1.0

# and from code usage:
# in node.js or io.js interactive console:
require('node-sass').info();

# or by script evaluation from CLI:
node -p "require('node-sass').info()"

# prints
node-sass version: 2.0.1
libsass version: 3.1.0

@sp90
Copy link

sp90 commented Feb 12, 2015

@am11 thanks great answer, +1

@dimitrinicolas dimitrinicolas changed the title @at-root don't work @at-root doesn't work Feb 22, 2018
@dovidweisz
Copy link

dovidweisz commented Feb 27, 2018

I just tried this in my repl and it looks like it works now. (three years later)

My sass.info is

node-sass	4.7.2	(Wrapper)	[JavaScript]
libsass  	3.5.0.beta.2	(Sass Compiler)	[C/C++]

@sass sass locked as resolved and limited conversation to collaborators Feb 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants