Skip to content

Commit be86cd3

Browse files
committed
Bump v0.7.0 — CSS Modules support in compile_css
New option `css_modules: true` in `Vize.compile_css/2` enables LightningCSS CSS Modules mode. Class names, IDs, keyframes, and other identifiers are scoped, and the result includes an `:exports` map of original → hashed names. Uses dannote/vize fork (branch css-modules) for vize_atelier_sfc until ubugeeei/vize#123 is merged upstream.
1 parent 1b5c8ac commit be86cd3

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

checksum-Elixir.Vize.Native.exs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
%{
2-
"libvize_ex_nif-v0.6.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" => "sha256:cbf2649c167faa1cbfdf7a96ae3e9b20d27c9393af5caaf65d64f4cf362159c1",
3-
"libvize_ex_nif-v0.6.0-nif-2.15-aarch64-unknown-linux-gnu.so.tar.gz" => "sha256:bcfa4802e87f6caba43ec036b27e40daa901d528aede09ff33c0d4bf4044deab",
4-
"libvize_ex_nif-v0.6.0-nif-2.15-x86_64-apple-darwin.so.tar.gz" => "sha256:ebf1565983765d95177b7be4928d3ed4f01271e6d49620178677d4bffc545311",
5-
"libvize_ex_nif-v0.6.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" => "sha256:01ba37bc259650ca584f53bf2037e471ad500e3fdc25248d0b7b524aedd473e2",
6-
"libvize_ex_nif-v0.6.0-nif-2.15-x86_64-unknown-linux-musl.so.tar.gz" => "sha256:46f96fe78d2a9e3d97a0eb8170589d1ab1f94226836f910c035f7af8eac43e97",
7-
}
1+
%{}

lib/vize.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,17 @@ defmodule Vize do
364364
Compile CSS using LightningCSS.
365365
366366
Parses, autoprefixes, and optionally minifies CSS. Also handles
367-
Vue scoped CSS transformation and `v-bind()` extraction.
367+
Vue scoped CSS transformation, `v-bind()` extraction, and CSS Modules.
368368
369369
## Options
370370
371371
* `:minify` — minify the output (default: `false`)
372372
* `:scoped` — apply Vue scoped CSS transformation (default: `false`)
373373
* `:scope_id` — scope ID for scoped CSS (e.g. `"data-v-abc123"`)
374374
* `:filename` — filename for error reporting
375+
* `:css_modules` — enable CSS Modules scoping (default: `false`).
376+
When enabled, class names, IDs, keyframes, and other identifiers are
377+
scoped, and the result includes an `:exports` map of original → hashed names.
375378
* `:targets` — browser targets for autoprefixing, map with optional
376379
`:chrome`, `:firefox`, `:safari` keys as major version integers
377380
@@ -382,6 +385,10 @@ defmodule Vize do
382385
true
383386
iex> result.errors
384387
[]
388+
389+
iex> {:ok, result} = Vize.compile_css(".btn { color: red }", css_modules: true, filename: "btn.module.css")
390+
iex> is_map(result.exports)
391+
true
385392
"""
386393
@spec compile_css(String.t(), keyword()) :: {:ok, css_result()}
387394
def compile_css(source, opts \\ []) do

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Vize.MixProject do
22
use Mix.Project
33

4-
@version "0.6.0"
4+
@version "0.7.0"
55
@source_url "https://github.com/elixir-volt/vize_ex"
66

77
def project do

0 commit comments

Comments
 (0)