fix!: bring the scope autocompletion in by changing style input syntax
BREAKING CHANGE: `styly`, `sassy` macros syntax change. Now requires `{"$code"}`.
This commit is contained in:
parent
c3ffef04c3
commit
c5c550f0ce
5 changed files with 133 additions and 101 deletions
9
examples/define-styles/Cargo.lock
generated
9
examples/define-styles/Cargo.lock
generated
|
|
@ -994,7 +994,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
|||
|
||||
[[package]]
|
||||
name = "sabry"
|
||||
version = "0.0.1-alpha.1"
|
||||
version = "0.0.1-alpha.2"
|
||||
dependencies = [
|
||||
"sabry_intrnl",
|
||||
"sabry_procmacro",
|
||||
|
|
@ -1002,10 +1002,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sabry_intrnl"
|
||||
version = "0.0.1-alpha.1"
|
||||
version = "0.0.1-alpha.2"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"blake3",
|
||||
"cfg-if",
|
||||
"const_format",
|
||||
"grass",
|
||||
"lightningcss",
|
||||
|
|
@ -1021,14 +1022,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sabry_procmacro"
|
||||
version = "0.0.1-alpha.1"
|
||||
version = "0.0.1-alpha.2"
|
||||
dependencies = [
|
||||
"sabry_procmacro_impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sabry_procmacro_impl"
|
||||
version = "0.0.1-alpha.1"
|
||||
version = "0.0.1-alpha.2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use sabry::sassy;
|
|||
|
||||
sassy!(style "src/style.scss");
|
||||
|
||||
sassy!(utils {
|
||||
sassy!(utils {"
|
||||
@mixin flex($direction, $align, $justify, $gap: .5rem) {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
|
|
@ -29,9 +29,9 @@ sassy!(utils {
|
|||
justify-content: $justify;
|
||||
}
|
||||
}
|
||||
});
|
||||
"});
|
||||
|
||||
sassy!(theme {
|
||||
sassy!(theme {"
|
||||
$thm-surface-primary: #2b2a29;
|
||||
$thm-surface-secondary: #6C6C6C;
|
||||
$thm-surface-tertiary: #4C4C4C;
|
||||
|
|
@ -75,10 +75,10 @@ sassy!(theme {
|
|||
color: $thm-text-accent;
|
||||
}
|
||||
}
|
||||
});
|
||||
"});
|
||||
|
||||
sassy!(tokens {
|
||||
@use "theme";
|
||||
sassy!(tokens {"
|
||||
@use 'theme';
|
||||
|
||||
@mixin clickable($style: accent, $scale: 1.2, $clickscale: 0.9){
|
||||
@if $style == accent{
|
||||
|
|
@ -103,4 +103,4 @@ sassy!(tokens {
|
|||
transform: scale($clickscale);
|
||||
}
|
||||
}
|
||||
});
|
||||
"});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use leptos::prelude::*;
|
||||
use sabry::styly;
|
||||
|
||||
styly!(style {
|
||||
@use "tokens";
|
||||
@use "utils";
|
||||
@use "theme";
|
||||
styly!(style {"
|
||||
@use 'tokens';
|
||||
@use 'utils';
|
||||
@use 'theme';
|
||||
|
||||
h2 {
|
||||
margin-bottom: 1rem;
|
||||
|
|
@ -35,7 +35,7 @@ styly!(style {
|
|||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
});
|
||||
"});
|
||||
|
||||
/// Renders the home page of your application.
|
||||
#[component]
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ use sabry::{sassy, usey};
|
|||
|
||||
// This module will have the same name as define_styles_example::utils
|
||||
// and sabry is configured to merge them
|
||||
sassy!(utils {
|
||||
sassy!(utils {"
|
||||
@mixin nonclickable(){
|
||||
display: none;
|
||||
}
|
||||
});
|
||||
"});
|
||||
|
||||
fn main(){
|
||||
/* Declare modules to use with sabry */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
use sabry::styly;
|
||||
|
||||
styly!(pub const bundlemod {
|
||||
@use "tokens";
|
||||
// Sabry now (0.0.1-alpha.3) disallows unquoted styles
|
||||
// you won't benefit from unqouted styles though, as you won't get syntax highlighting
|
||||
// Also, unqouted styles are reserved for future
|
||||
styly!(pub const bundlemod {"
|
||||
@use 'tokens';
|
||||
.someth {
|
||||
@include tokens.clickable;
|
||||
background-color: black;
|
||||
|
|
@ -9,7 +12,9 @@ styly!(pub const bundlemod {
|
|||
background-color: white;
|
||||
}
|
||||
}
|
||||
});
|
||||
"});
|
||||
|
||||
styly!(pub filemod:sass "src/main.sass");
|
||||
|
||||
fn main(){
|
||||
println!("someth class codemod styles: {}", bundlemod::someth);
|
||||
|
|
|
|||
Loading…
Reference in a new issue