Skip to content

Commit

Permalink
Merge pull request #148 from ntkme/update-sass
Browse files Browse the repository at this point in the history
Update to latest sass with sass-embedded gem
  • Loading branch information
brettchalupa authored Jul 3, 2024
2 parents 59054ad + 24cda98 commit 3a0eb90
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'
require 'ostruct'

module GraphQLDocs
Expand Down Expand Up @@ -85,8 +86,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 3a0eb90

Please sign in to comment.