rails_critical_css 0.3.7 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77467407b3faaca39cea6db6b578d6cefa0635ccc221bb53087a9ac348840b62
4
- data.tar.gz: f8e5c8caccdcefa8265d5756c2b9780aa11fd74bfc0557ae325583e4ad1eff09
3
+ metadata.gz: 3dcc6df3b31671a12227c9b6a76dc4f9bd93de2238ad815d45fad52a585d2045
4
+ data.tar.gz: a3efe8b44475688051c88350848acefdd9e084e19153b1e81cca652d769e9e1c
5
5
  SHA512:
6
- metadata.gz: b4c47e5b244785bdc403d2267fc198fc18040ee65cb38ea1ecebfe501b7a8d922d0706a93110d0a093a0cf6fe889be33c1b4b06d3a3edf17686620ce9bb07c26
7
- data.tar.gz: 0a9f6cc4626c8c9bfcb3a091f0b30439bb826b35e35ca9544391b7b1c49eb4589460b6ecec7340cfe2f869caf76dc9efb8cfe6a2e3b2f53586b0148b583b6ee2
6
+ metadata.gz: 9430cb40e82adb501e48143441ec4c2be59cb6170b62124578d022e2ee2fdea79ba2ba94555f947dbb3be3cb179452932fcb2dbc4187d895cc1a7afbca34f201
7
+ data.tar.gz: e0e13e590e62b1870ec0aad69b4cdd9bf1f8ee64a99f7e384ebb1d53271bca59ec7743f7ec3a8bd63e6dedda9416942ca6ba98a61d436f8bd3db4bc0ba347aba
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_critical_css (0.3.7)
4
+ rails_critical_css (0.4.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -56,7 +56,8 @@ In template:
56
56
 
57
57
  # depending on critical_css? flag (it returns false if critical css is being generated)
58
58
  # it emits link(href="your_file" rel="stylesheet") or link(href="your_file" rel="preload" onload="this.rel = 'stylesheet'")
59
- = critical_css_link href: 'css/vendors.css'
59
+ = critical_css_link 'css/vendors.css'
60
+ = critical_css_link 'css/vendors.css', media: 'print'
60
61
 
61
62
  # If you have custom link helper (which for example loads css tag after GDPR accept) you can use helper below
62
63
  # Generator will extract hrefs from emitted html and generate stylesheet output
@@ -31,11 +31,13 @@ module RailsCriticalCss::Helpers
31
31
  end
32
32
  end
33
33
 
34
- def critical_css_link(href:, media: nil)
34
+ def critical_css_link(href, media: nil)
35
35
  if critical_css?
36
- link_to href: href, rel: 'preload', as: 'style', media: media, onload: "this.rel = 'stylesheet'"
36
+ link_to(href: href, rel: 'preload', as: 'style', media: media, onload: "this.rel = 'stylesheet'")
37
37
  else
38
- link_to href: href, rel: 'stylesheet', media: media
38
+ append_css_tags_assets do
39
+ link_to(href: href, rel: 'stylesheet', media: media)
40
+ end
39
41
  end
40
42
  end
41
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsCriticalCss
4
- VERSION = '0.3.7'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_critical_css
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Bagiński