Skip to content

Invalid function names #1265

@KittyGiraudel

Description

@KittyGiraudel

A couple of months ago, I opened an issue regarding functions called true(), false() and null() that didn't work as expected.

Today, I found out functions called and(), or() and not() are even worse. Both and() and or() returns a syntax error when called (not declared):

@function and() {
  @return "and"
}

test {
  and: and();
}

Invalid CSS after " and: ": expected expression (e.g. 1px, bold), was "and();"

@function or() {
  @return "or"
}

test {
  or: or();
}

Invalid CSS after " or: ": expected expression (e.g. 1px, bold), was "or();"

The not() function on the other side partially works. It doesn't throw any error but it returns false, no matter what.

@function not() {
  @return "not"
}

test {
  not: not();
}
test {
  not: false;
}

Tested on Sass 3.3.6 and 3.2.19. Curious things is everything works like a charm with LibSass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions