Skip to content

Commit

Permalink
Update to latest sass with sass-embedded gem
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Feb 23, 2024
1 parent d39cc1b commit 9526875
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion graphql-docs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'extended-markdown-filter', '~> 0.4'
spec.add_dependency 'gemoji', '~> 3.0'
spec.add_dependency 'html-pipeline', '>= 2.14.3', '~> 2.14'
spec.add_dependency 'dartsass', '~> 1.49'
spec.add_dependency 'sass-embedded', '~> 1.58'

spec.add_development_dependency 'html-proofer', '~> 3.4'
spec.add_development_dependency 'minitest', '~> 5.0'
Expand Down
5 changes: 3 additions & 2 deletions lib/graphql-docs/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'erb'
require 'fileutils'
require 'sass-embedded'

module GraphQLDocs
class Generator
Expand Down Expand Up @@ -84,8 +85,8 @@ def generate
assets_dir = File.join(File.dirname(__FILE__), 'layouts', 'assets')
FileUtils.mkdir_p(File.join(@options[:output_dir], 'assets'))

sass = File.join(assets_dir, 'css', 'screen.scss')
system `dartsass --no-source-map=none #{sass} #{@options[:output_dir]}/assets/style.css`
css = Sass.compile(File.join(assets_dir, 'css', 'screen.scss')).css
File.write(File.join(@options[:output_dir], 'assets', 'style.css'), css)

FileUtils.cp_r(File.join(assets_dir, 'images'), File.join(@options[:output_dir], 'assets'))
FileUtils.cp_r(File.join(assets_dir, 'webfonts'), File.join(@options[:output_dir], 'assets'))
Expand Down

0 comments on commit 9526875

Please sign in to comment.