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

Fix stylelint violations #1150

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions lib/generators/suspenders/styles_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ def build_directory_structure
return if is_tailwind?

create_file "app/assets/stylesheets/base.css"
append_to_file "app/assets/stylesheets/base.css", "/* Base Styles */"

create_file "app/assets/stylesheets/components.css"
append_to_file "app/assets/stylesheets/components.css", "/* Component Styles */"

create_file "app/assets/stylesheets/utilities.css"
append_to_file "app/assets/stylesheets/utilities.css", "/* Utility Styles */"
end

# Modify if https://github.com/rails/cssbundling-rails/pull/139 is merged
Expand Down
12 changes: 9 additions & 3 deletions test/generators/suspenders/styles_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,15 @@ class StylesGenerator::PostCssTest < Rails::Generators::TestCase
test "creates stylesheets" do
run_generator

assert_file app_root("app/assets/stylesheets/base.css")
assert_file app_root("app/assets/stylesheets/components.css")
assert_file app_root("app/assets/stylesheets/utilities.css")
assert_file app_root("app/assets/stylesheets/base.css") do |file|
assert_equal "/* Base Styles */", file
end
assert_file app_root("app/assets/stylesheets/components.css") do |file|
assert_equal "/* Component Styles */", file
end
assert_file app_root("app/assets/stylesheets/utilities.css") do |file|
assert_equal "/* Utility Styles */", file
end
end

private
Expand Down