Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest sass with sass-embedded gem #148

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
brettchalupa marked this conversation as resolved.
Show resolved Hide resolved

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
Loading