Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Unwanted zero added before .<number> in CSS #4025

Open
1 task done
yoavbls opened this issue Sep 21, 2024 · 2 comments
Open
1 task done

📝 Unwanted zero added before .<number> in CSS #4025

yoavbls opened this issue Sep 21, 2024 · 2 comments
Labels
L-CSS Language: CSS

Comments

@yoavbls
Copy link

yoavbls commented Sep 21, 2024

Unwanted zero is added when we're using one of our utils
so

.div {
  margin-left: theme(spacing.2);  
}

become:

.div {
  margin-left: theme(spacing 0.2);  
}

which is not the intention and doesn't happen with Prettier or VSCode default formatter.

Thank you very much for your amazing work on Biome 🙏🏼

Environment information

CLI:
  Version:                      1.9.2
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.10.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/4.5.0"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Formatter:
  Format with errors:           false
  Indent style:                 Space
  Indent width:                 2
  Line ending:                  Lf
  Line width:                   80
  Attribute position:           Auto
  Bracket spacing:              BracketSpacing(true)
  Ignore:                       []
  Include:                      []

JavaScript Formatter:
  Enabled:                      false
  JSX quote style:              Double
  Quote properties:             AsNeeded
  Trailing commas:              Es5
  Semicolons:                   Always
  Arrow parentheses:            AsNeeded
  Bracket spacing:              BracketSpacing(true)
  Bracket same line:            false
  Quote style:                  Single
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           Auto

JSON Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset

CSS Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  Single

GraphQL Formatter:
  Enabled:                      true
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Bracket spacing:              unset
  Quote style:                  unset

Workspace:
  Open Documents:               0

Configuration

{
  "css": {
    "linter": {
      "enabled": false
    },
    "formatter": {
      "enabled": true,
      "quoteStyle": "single"
    },
    "parser": {
      "cssModules": true,
      "allowWrongLineComments": true
    }
  }
}

Playground link

https://biomejs.dev/playground/?files.main.css=LgBkAGkAdgAgAHsACgAgACAAbQBhAHIAZwBpAG4ALQBsAGUAZgB0ADoAIAB0AGgAZQBtAGUAKABzAHAAYQBjAGkAbgBnAC4AMgApADsAIAAgAAoAfQA%3D

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@yoavbls yoavbls changed the title 📝 Unwanted zero added before .<number> 📝 Unwanted zero added before .<number> in CSS Sep 21, 2024
@ematipico
Copy link
Member

The file contains invalid CSS syntax. I suppose you're using tailwind, which uses invalid/proposed syntax that isn't official yet

@yoavbls
Copy link
Author

yoavbls commented Sep 21, 2024

Yes, it is utility related to tailwind.
I would not treat [a-zA-Z].\d as a number but I understand it could happen because of the invalid syntax and out of scope.
Thank you either way 🙏🏼

@dyc3 dyc3 added the L-CSS Language: CSS label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-CSS Language: CSS
Projects
None yet
Development

No branches or pull requests

3 participants