We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c323769 + ac8d92d commit 45995b3Copy full SHA for 45995b3
lib/ex_css_modules/view.ex
@@ -18,17 +18,20 @@ defmodule ExCSSModules.View do
18
"""
19
20
defmacro __using__(opts \\ []) do
21
- {file, [file: relative_to]} =
+ {filename, [file: relative_to]} =
22
Code.eval_quoted(opts[:stylesheet], file: __CALLER__.file)
23
24
- file = Path.expand(file, Path.dirname(relative_to))
+ {embed, _} =
25
+ Code.eval_quoted(opts[:embed_stylesheet])
26
+
27
+ filename = Path.expand(filename, Path.dirname(relative_to))
28
29
quote do
30
@stylesheet unquote(
- if opts[:embed_stylesheet] do
- Macro.escape(ExCSSModules.read_stylesheet(file))
31
+ if embed do
32
+ Macro.escape(ExCSSModules.read_stylesheet(filename))
33
else
- Macro.escape(file)
34
+ Macro.escape(filename)
35
end
36
)
37
0 commit comments