Conversation
✅ Deploy Preview for sass-site-oddbird ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
@mirisuzanne and @stacyk - could you try out the Autocomplete here and see if it works well and as expected? |
mirisuzanne
left a comment
There was a problem hiding this comment.
- At-rules: works great
- Built in module names: only works with e.g.
"sass:math", not'sass:math'. Should probably work with single-quotes as well? - Built in variables: works great
- Built in functions: works great
Good catch! Fixed. |
jgerigmeyer
left a comment
There was a problem hiding this comment.
@jamesnw Works great! Obviously it would be ideal if we could get some of these values (e.g. at-rules, modules, etc) dynamically from Sass itself. I assume you looked into that and they're not being exposed currently? It might even be worth mentioning that to Natalie to see what she thinks.
| const atRuleKeywords = [ | ||
| 'use', | ||
| 'forward', | ||
| 'import', | ||
| 'mixin', | ||
| 'include', | ||
| 'function', | ||
| 'extend', | ||
| 'error', | ||
| 'warn', | ||
| 'debug', | ||
| 'at-root', | ||
| 'if', | ||
| 'else', | ||
| 'each', | ||
| 'for', | ||
| 'while', | ||
| ]; |
There was a problem hiding this comment.
Do we want to add @media, @supports, and @keyframes here? And maybe also add autocomplete for other CSS at-rules?
There was a problem hiding this comment.
I think css at-rules would be good to consider supporting. Hopefully there's a clear enough division between that and auto-completing css properties/values, so this doesn't become a very slippery scope slope.
There was a problem hiding this comment.
I think that probably should go upstream into @codemirror/lang-css- that shouldn't be too challenging, I don't think.
We are already getting auto-completion of css properties and values from that package.
There was a problem hiding this comment.
Makes sense -- add a comment or file a new issue so we don't lose track?
|
|
||
| const builtinModules: ModuleDefinition[] = [ | ||
| { | ||
| name: 'color', |
There was a problem hiding this comment.
Is there a reason we're not including the color functions (e.g. adjust, scale, etc) here?
There was a problem hiding this comment.
I'm holding out hope there's a way to get this from Sass directly, as this is a long list, and will be changing once the CSS Color 4 changes are made in Sass.
There was a problem hiding this comment.
Makes sense -- add a comment so we don't forget?
|
@jamesnw Will this story (or any future stories) include autocompleting CSS properties? For instance, in the SCSS panel, if I type I was expecting to see |
The issue is the missing
|
|
@jamesnw I'm not sure the full scope of this story or if it is even unexpected, but I noticed when I type |
I'm literally LOL |
This is another instance of confusing the parser. Without the end quote, the parser doesn't know it's a StringLiteral, and thinks it's a pseudoclass. I pushed a change that should address it. |
stacyk
left a comment
There was a problem hiding this comment.
The update you made for the autocomplete without the final quote works great!
| indentWithTab, | ||
| } from '@codemirror/commands'; | ||
| import {css as langCss} from '@codemirror/lang-css'; | ||
| import {css as langCss, cssCompletionSource} from '@codemirror/lang-css'; |
There was a problem hiding this comment.
Unused import?
| import {css as langCss, cssCompletionSource} from '@codemirror/lang-css'; | |
| import {css as langCss} from '@codemirror/lang-css'; |
| const atRuleKeywords = [ | ||
| 'use', | ||
| 'forward', | ||
| 'import', | ||
| 'mixin', | ||
| 'include', | ||
| 'function', | ||
| 'extend', | ||
| 'error', | ||
| 'warn', | ||
| 'debug', | ||
| 'at-root', | ||
| 'if', | ||
| 'else', | ||
| 'each', | ||
| 'for', | ||
| 'while', | ||
| ]; |
There was a problem hiding this comment.
Makes sense -- add a comment or file a new issue so we don't lose track?
|
|
||
| const builtinModules: ModuleDefinition[] = [ | ||
| { | ||
| name: 'color', |
There was a problem hiding this comment.
Makes sense -- add a comment so we don't forget?
|
Moving to sass repo- sass#1166 |



Description
Adds Sass-specific Autocomplete
Related Issue(s)
#78
Steps to test/reproduce
Go to Playground, type in Sass-specific words.
@use,@debug, etc.@use "sass:math", for instancemath.$pimath.clamp