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

Sass compatibility: Handling of slashes in CSS values #82

Open
ghen-arvesu opened this issue Feb 12, 2024 · 2 comments
Open

Sass compatibility: Handling of slashes in CSS values #82

ghen-arvesu opened this issue Feb 12, 2024 · 2 comments

Comments

@ghen-arvesu
Copy link

Hi @eliot-akira , looks like the new code editor cannot handle the CSS value below,it possible that it’s a problem with the slashes

grid-area: 1 / 1 / 2 / 2;

image

Work around:

 grid-row-start: 1;
 grid-column-start: 1;
 grid-row-end: 2;
 grid-column-end: 2;

Bug Source:
https://discourse.tangible.one/t/code-editor-handling-of-slashes-in-css-values/1201

@ghen-arvesu
Copy link
Author

Hi @eliot-akira

The customer noticed that the issue could be related to restricting maths inside of the calc property for CCS as it looks like its automatically doing calculations. Hope this help. thank you

eliot-akira added a commit that referenced this issue Mar 8, 2024
- Resolves #85
- Add tests for edge cases
- Known issue with handling of slashes in CSS values
  - scssphp/scssphp#146
  - See #82 - Workaround is to use `unquote('..')`
@eliot-akira
Copy link
Contributor

eliot-akira commented Mar 8, 2024

Thanks @ghen-arvesu. I've upgraded the Sass compiler (the PHP port we're using), but it turns out this is a known issue that's not solved yet.

For CSS properties that use a slash for any purpose other than division, the compiler doesn't yet support the syntax - and replaces it with the calculated value. The issue has been unsolved for a while, so I'm guessing it's not easy to fix.

As a workaround, the value can be wrapped with unquote('..'). For example:

grid-area: unquote('1 / 1 / 2 / 2');

I'll leave this issue open until it's solved "upstream" in the SCSS-PHP library.

We might move away from Sass in the future, since it's a bit of burden for maintenance - but some of its features are useful and still not possible with regular CSS.

An idea I'm considering is to use the official Sass compiler (written in Dart and server-side only) compiled to WebAssembly to run in the browser. That would ensure compatibility with the newest Sass/CSS specifications. But there will be questions to solve, like how to replace our current use of local Sass variables with CSS variables. I've opened a new issue #88 to keep track of the idea.

@eliot-akira eliot-akira changed the title Code editor handling of slashes in CSS values Sass compatibility: Handling of slashes in CSS values Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants