active-css icon indicating copy to clipboard operation
active-css copied to clipboard

Add a @switch command to the control flow

Open bob2517-whiteline opened this issue 2 years ago • 1 comments

Would be good to have this, and it would be more performant. Needs to work with break, continue, exit, etc.

bob2517-whiteline avatar Jan 31 '23 09:01 bob2517-whiteline

Initial example syntax for this CSS-ified:

@switch ($var|expr) {
    @case 'Joan' {
    }
    @case $something, 'text', $somethingElse, jsExpression {
        @break;
    }
    @case 'Dave' {
    }
    @default {
    }
}

This statement would operate mostly like the JS switch statement. We shouldn't need additional case statements for the same result flow with a comma-delimited syntax.

bob2517 avatar Sep 30 '23 17:09 bob2517