15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/wabi/generators/theme_generator.rb', line 15
def fetch_and_write
lockfile = Wabi::Lockfile.load(File.join(destination_root, "config/wabi.lock.json"))
base = lockfile.registry
shared = fetch("#{base}/themes/_shared.css", label: "_shared")
body = fetch("#{base}/themes/#{slug}.css", label: slug)
target = File.join(destination_root, "app/assets/tailwind/wabi/tokens.css")
FileUtils.mkdir_p(File.dirname(target))
File.write(target, [shared, body].join("\n"))
say " theme → #{slug}", :green
say " wrote app/assets/tailwind/wabi/tokens.css", :green
say " Run `bin/rails tailwindcss:build` to compile the new palette.", :cyan
end
|