Skip to content

Commit

Permalink
Make components CSS available to static
Browse files Browse the repository at this point in the history
- applications include the styles for the components as part of the application's css, but static does not
- this means gem components viewed in the static component guide are not styled, which can cause accessibility errors to trigger
- adds logic and a couple of stylesheets to pull in the component styles if static is the application
  • Loading branch information
andysellick committed Apr 26, 2018
1 parent 95061c3 commit b33f3ff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/assets/stylesheets/component_guide/all_components.scss
@@ -0,0 +1 @@
@import "../govuk_publishing_components/all_components";
@@ -0,0 +1 @@
@import "../govuk_publishing_components/all_components_print";
Expand Up @@ -12,6 +12,12 @@
</title>
<%= stylesheet_link_tag "component_guide/application", media: "screen" %>
<%= stylesheet_link_tag "#{GovukPublishingComponents::Config.application_stylesheet}" %>
<% if GovukPublishingComponents::Config.static %>
<%= stylesheet_link_tag "component_guide/all_components", media: "screen" %>
<%= stylesheet_link_tag "component_guide/all_components_print", media: "print" %>
<% end %>
<% if GovukPublishingComponents::Config.application_print_stylesheet %>
<%= stylesheet_link_tag "#{GovukPublishingComponents::Config.application_print_stylesheet}", media: "print" %>
<% end %>
Expand Down
7 changes: 6 additions & 1 deletion config/initializers/assets.rb
@@ -1 +1,6 @@
Rails.application.config.assets.precompile += %w(govuk_publishing_components/component_guide.css govuk_publishing_components/search-button.png)
Rails.application.config.assets.precompile += %w(
govuk_publishing_components/component_guide.css
component_guide/all_components.css
component_guide/all_components_print
govuk_publishing_components/search-button.png
)

0 comments on commit b33f3ff

Please sign in to comment.