bep / godartsass

Go API backed by the native Dart Sass Embedded executable.
MIT License
42 stars 7 forks source link

Allow user defined functions capability #10

Closed septs closed 1 year ago

septs commented 1 year ago

Allow hugo define hugo-specific built-in sass functions

Improve development experience (simplify reference resource files)

Replaced by https://github.com/bep/golibsass/issues/7

https://github.com/bep/godartsass/blob/9f9f1c1aeb19fa45147bf1ca123e73a8dec85e66/internal/embeddedsass/embedded_sass.proto#L537-L568

https://github.com/bep/godartsass/blob/9f9f1c1aeb19fa45147bf1ca123e73a8dec85e66/internal/embeddedsass/embedded_sass.proto#L220-L239

septs commented 1 year ago

https://github.com/sass/embedded-host-node/blob/main/lib/src/function-registry.ts

https://github.com/sass/embedded-host-node/blob/master/lib/src/compile.ts#L121

https://github.com/sass/embedded-host-node/blob/master/lib/src/compile.ts#L154

septs commented 1 year ago

i want use sass function, improve developer experience

port resources series api into sass compiler, simplify use image file steps

bep commented 1 year ago

port resources series api into sass compiler, simplify use image file steps

Next Hugo allows you pass the URL of these image resources as variables to Dart Sass. How is your suggested approach better? To me it sounds

bep commented 1 year ago

Note, that I don't mind adding a "functions API" to this library as long as someone could

septs commented 1 year ago
.example {
  --use-file-with-function: resources-get(file-path); // intuitive
  // vs
  --use-file-with-variable: $injected-file-name; // define separation
}
bep commented 1 year ago