Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Reserved function names #713

Closed
Closed

Description

@KittyGiraudel

Sass should throw an error if one tries to create functions called or, and and not. This is an issue I opened in Sass repo a while ago: sass/sass#1265.

Test:

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

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

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

test {
  not: not();
  or: or();
  and: and();
}

Expect:

Invalid function name "and".

Result:

test {
  not: "not";
  or: "or";
  and: "and"; }

Ref: http://sass-compatibility.github.io/#reserved_function_names

Activity

  1. xzyfer commented on Dec 11, 2014

    @xzyfer
    Contributor
  2. xzyfer commented on Dec 11, 2014

    @xzyfer
    Contributor

    This behaviour changed in Sass 3.3.9 - http://sass-lang.com/documentation/file.SASS_CHANGELOG.html#339_27_june_2014

    Defining a function named “and”, “or”, or “not” is now an error at definition-time. This isn’t considered a backwards-incompatible change because although these functions could be defined previously, they could never be successfully invoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions