bigcartel-theme-fonts 1.4.0 → 1.4.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 937a4cc82e055861612a5304f8e14f040bf5661176bb3d63f4d53e45e2a3c85f
|
4
|
+
data.tar.gz: 60b0d74b6c92a90c395a41f37957c3cf6422a32db6da8752a375ad3b1c68aed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9f7b2bf885a5148b17141c03633e0ea5a4363302564aaaba3d1299f05323dfc7baf78f6cb60f209b147be78853fd687a372c30e1e96e9bb9751fae0b3bc721b
|
7
|
+
data.tar.gz: 887806d277870a480ed787306d2f37ec5f5be3262dfcabb13f2fe09ab214c71afa2a86d73d3c5c49708dbc16868f329cefaaeb36f151df4a52253aca3ed5eee5
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'bigcartel-theme-fonts'
|
7
|
-
spec.version = '1.4.
|
7
|
+
spec.version = '1.4.2'
|
8
8
|
spec.authors = ['Big Cartel']
|
9
9
|
spec.email = ['dev@bigcartel.com']
|
10
10
|
spec.description = %q{A simple class for working with Big Cartel's supported theme fonts.}
|
@@ -49,7 +49,7 @@ class ThemeFont < Struct.new(:name, :family, :weights, :collection)
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
"//fonts.googleapis.com/css?family=#{ fonts.uniq.map { |font| font.gsub(' ', '+') }.join('|') }"
|
52
|
+
"//fonts.googleapis.com/css?family=#{ fonts.uniq.map { |font| font.gsub(' ', '+') }.join('|') }&display=swap"
|
53
53
|
end
|
54
54
|
|
55
55
|
def google_font_url_for_all_fonts
|
data/spec/theme_font_spec.rb
CHANGED
@@ -73,15 +73,15 @@ describe ThemeFont do
|
|
73
73
|
|
74
74
|
describe ".google_font_url_for_fonts" do
|
75
75
|
it "should return a url for a given array of font names" do
|
76
|
-
ThemeFont.google_font_url_for_fonts(['Oh Hey', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Oh+Hey|Buddy|Yeah"
|
76
|
+
ThemeFont.google_font_url_for_fonts(['Oh Hey', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Oh+Hey|Buddy|Yeah&display=swap"
|
77
77
|
end
|
78
78
|
|
79
79
|
it "should return a url for a singular font in an array" do
|
80
|
-
ThemeFont.google_font_url_for_fonts(['Oh Hey']).should == "//fonts.googleapis.com/css?family=Oh+Hey"
|
80
|
+
ThemeFont.google_font_url_for_fonts(['Oh Hey']).should == "//fonts.googleapis.com/css?family=Oh+Hey&display=swap"
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should only use unique font names" do
|
84
|
-
ThemeFont.google_font_url_for_fonts(['Yeah', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Yeah|Buddy"
|
84
|
+
ThemeFont.google_font_url_for_fonts(['Yeah', 'Buddy', 'Yeah']).should == "//fonts.googleapis.com/css?family=Yeah|Buddy&display=swap"
|
85
85
|
end
|
86
86
|
|
87
87
|
context "when the fonts are an array of ThemeFonts" do
|
@@ -93,7 +93,7 @@ describe ThemeFont do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
it "includes font weights in the URL" do
|
96
|
-
ThemeFont.google_font_url_for_fonts(fonts).should == "//fonts.googleapis.com/css?family=One+Font:400,500|Two+Font:500,700,800"
|
96
|
+
ThemeFont.google_font_url_for_fonts(fonts).should == "//fonts.googleapis.com/css?family=One+Font:400,500|Two+Font:500,700,800&display=swap"
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
@@ -108,7 +108,7 @@ describe ThemeFont do
|
|
108
108
|
end
|
109
109
|
|
110
110
|
it "should return a URL for all Google fonts" do
|
111
|
-
ThemeFont.google_font_url_for_all_fonts.should == "//fonts.googleapis.com/css?family=One+Font|Three:400,600"
|
111
|
+
ThemeFont.google_font_url_for_all_fonts.should == "//fonts.googleapis.com/css?family=One+Font|Three:400,600&display=swap"
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
@@ -125,17 +125,17 @@ describe ThemeFont do
|
|
125
125
|
|
126
126
|
it "should return a URL if a theme has multiple" do
|
127
127
|
settings = { :header_font => 'One Font', :body_font => 'Two', :paragraph_font => 'Three' }
|
128
|
-
ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700|Three"
|
128
|
+
ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700|Three&display=swap"
|
129
129
|
end
|
130
130
|
|
131
131
|
it "should return single font name if a theme has one" do
|
132
132
|
settings = { :header_font => 'One Font', :body_font => 'Two' }
|
133
|
-
ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700"
|
133
|
+
ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700&display=swap"
|
134
134
|
end
|
135
135
|
|
136
136
|
it "should dedup" do
|
137
137
|
settings = { :header_font => 'One Font', :body_font => 'One Font' }
|
138
|
-
ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700"
|
138
|
+
ThemeFont.google_font_url_for_theme(fonts, settings).should == "//fonts.googleapis.com/css?family=One+Font:400,700&display=swap"
|
139
139
|
end
|
140
140
|
|
141
141
|
it "should return nil if a theme has none" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigcartel-theme-fonts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Big Cartel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|