Skip to content

Commit

Permalink
Prevent @imported css from getting in queue behind the javascript
Browse files Browse the repository at this point in the history
This forces the css to the head of the queue which prevents a flash of unstyled content
  • Loading branch information
jcoyne committed Aug 23, 2024
1 parent e39a234 commit e4d81b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
matrix:
ruby: ['3.2', '3.3']
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Prepare application
run: bin/setup
- name: Run tests
run: bundle exec rake ci
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Prepare application
run: bin/rails test:prepare
- name: Run tests
run: bundle exec rake ci
11 changes: 0 additions & 11 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
/* GeoBlacklight (compiled locally by cssbundling-rails) */
@import url("geoblacklight.css");

/* EarthWorks */
@import url("earthworks.css");

/* Component library */
@import url("https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2024-08-13/styles/sul.css");

/* Bootstrap Icons */
@import url("https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css");
6 changes: 5 additions & 1 deletion app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
</script>
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
<%= favicon_link_tag %>
<%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "geoblacklight", media: "all", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "earthworks", media: "all", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2024-08-13/styles/sul.css" %>
<%= stylesheet_link_tag "https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css" %>
<% if defined? Importmap %>
<%= javascript_importmap_tags %>
<% elsif defined? Propshaft %>
Expand Down

0 comments on commit e4d81b0

Please sign in to comment.