sul_styles 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.fontcustom-manifest.json +183 -19
  3. data/.gitignore +2 -1
  4. data/.rspec +1 -0
  5. data/.travis.yml +3 -0
  6. data/Gemfile +17 -0
  7. data/README.md +21 -1
  8. data/Rakefile +13 -0
  9. data/app/assets/fonts/sul-icons.eot +0 -0
  10. data/app/assets/fonts/sul-icons.svg +321 -0
  11. data/app/assets/fonts/sul-icons.ttf +0 -0
  12. data/app/assets/fonts/sul-icons.woff +0 -0
  13. data/{assets → app/assets}/stylesheets/_sul-icons-aliases.scss +4 -4
  14. data/app/assets/stylesheets/_sul-icons-rails.scss +137 -0
  15. data/app/assets/stylesheets/_sul-icons.scss +187 -0
  16. data/app/assets/stylesheets/styleguide/styleguide.scss +52 -0
  17. data/app/assets/stylesheets/styleguide.scss +1 -0
  18. data/{assets → app/assets}/stylesheets/sul-styles/su_primary_colors.scss +4 -1
  19. data/{assets → app/assets}/stylesheets/sul-styles/su_web_colors.scss +4 -1
  20. data/{assets → app/assets}/stylesheets/sul-styles.scss +1 -1
  21. data/app/controllers/sul_styles/style_guide_controller.rb +47 -0
  22. data/app/views/layouts/styleguide.html.erb +22 -0
  23. data/app/views/sul_styles/style_guide/colors.html.erb +18 -0
  24. data/app/views/sul_styles/style_guide/icons.html.erb +19 -0
  25. data/app/views/sul_styles/style_guide/index.html.erb +0 -0
  26. data/bin/rails +12 -0
  27. data/config/locales/sul_styles.en.yml +4 -0
  28. data/config/routes.rb +5 -0
  29. data/docs/styleguide/sul-icons-preview.html +640 -25
  30. data/fontcustom.yml +2 -2
  31. data/lib/generators/sul_styles/install_generator.rb +16 -0
  32. data/lib/sul_styles/engine.rb +17 -0
  33. data/lib/sul_styles/version.rb +1 -1
  34. data/lib/sul_styles.rb +1 -12
  35. data/sul_styles.gemspec +5 -0
  36. metadata +82 -15
  37. data/assets/fonts/sul-icons.eot +0 -0
  38. data/assets/fonts/sul-icons.svg +0 -73
  39. data/assets/fonts/sul-icons.ttf +0 -0
  40. data/assets/fonts/sul-icons.woff +0 -0
  41. data/assets/stylesheets/_sul-icons-rails.scss +0 -55
  42. data/assets/stylesheets/_sul-icons.scss +0 -64
  43. data/bin/console +0 -14
  44. data/bin/setup +0 -7
@@ -0,0 +1,187 @@
1
+ //
2
+ // Icon Font: sul-icons
3
+ //
4
+
5
+ @font-face {
6
+ font-family: "sul-icons";
7
+ src: url("sul-icons.eot");
8
+ src: url("sul-icons.eot?#iefix") format("embedded-opentype"),
9
+ url("sul-icons.woff") format("woff"),
10
+ url("sul-icons.ttf") format("truetype"),
11
+ url("sul-icons.svg#sul-icons") format("svg");
12
+ font-weight: normal;
13
+ font-style: normal;
14
+ }
15
+
16
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
17
+ @font-face {
18
+ font-family: "sul-icons";
19
+ src: url("sul-icons.svg#sul-icons") format("svg");
20
+ }
21
+ }
22
+
23
+ [data-icon]:before { content: attr(data-icon); }
24
+
25
+ [data-icon]:before,
26
+ .sul-i-arrow-left-3:before,
27
+ .sul-i-arrow-left-8:before,
28
+ .sul-i-arrow-right-3:before,
29
+ .sul-i-arrow-right-8:before,
30
+ .sul-i-book-open-4:before,
31
+ .sul-i-bookmark-all-1:before,
32
+ .sul-i-books-library:before,
33
+ .sul-i-box-1:before,
34
+ .sul-i-bubble-chat-2:before,
35
+ .sul-i-camera-film-1:before,
36
+ .sul-i-check-box-1:before,
37
+ .sul-i-cube:before,
38
+ .sul-i-download-3:before,
39
+ .sul-i-email:before,
40
+ .sul-i-expand-1:before,
41
+ .sul-i-file-music-1:before,
42
+ .sul-i-graph-bar-2:before,
43
+ .sul-i-infomation-circle:before,
44
+ .sul-i-key-2:before,
45
+ .sul-i-layout-4:before,
46
+ .sul-i-layout-none:before,
47
+ .sul-i-link-3:before,
48
+ .sul-i-list-bullets-1:before,
49
+ .sul-i-map-pin-1:before,
50
+ .sul-i-microphone-3:before,
51
+ .sul-i-mobile-phone-2:before,
52
+ .sul-i-mouse:before,
53
+ .sul-i-navigation-drawer-1:before,
54
+ .sul-i-navigation-drawer-2:before,
55
+ .sul-i-navigation-left-2:before,
56
+ .sul-i-network-web:before,
57
+ .sul-i-news-article:before,
58
+ .sul-i-newspaper:before,
59
+ .sul-i-notebook:before,
60
+ .sul-i-person-1:before,
61
+ .sul-i-person-information-1:before,
62
+ .sul-i-picture-2:before,
63
+ .sul-i-plug-1:before,
64
+ .sul-i-print-text:before,
65
+ .sul-i-quote-1:before,
66
+ .sul-i-search:before,
67
+ .sul-i-share:before,
68
+ .sul-i-transfer-3:before,
69
+ .sul-i-turntable:before,
70
+ .sul-i-view-headline:before,
71
+ .sul-i-view-list:before,
72
+ .sul-i-view-module-1:before,
73
+ .sul-i-window-search:before,
74
+ .sul-i-zoom-in:before {
75
+ display: inline-block;
76
+ font-family: "sul-icons";
77
+ font-style: normal;
78
+ font-weight: normal;
79
+ font-variant: normal;
80
+ line-height: 1;
81
+ text-decoration: inherit;
82
+ text-rendering: optimizeLegibility;
83
+ text-transform: none;
84
+ -moz-osx-font-smoothing: grayscale;
85
+ -webkit-font-smoothing: antialiased;
86
+ font-smoothing: antialiased;
87
+ }
88
+
89
+ .sul-i-arrow-left-3:before { content: "\f108"; }
90
+ .sul-i-arrow-left-8:before { content: "\f109"; }
91
+ .sul-i-arrow-right-3:before { content: "\f10a"; }
92
+ .sul-i-arrow-right-8:before { content: "\f10b"; }
93
+ .sul-i-book-open-4:before { content: "\f10c"; }
94
+ .sul-i-bookmark-all-1:before { content: "\f10d"; }
95
+ .sul-i-books-library:before { content: "\f10e"; }
96
+ .sul-i-box-1:before { content: "\f10f"; }
97
+ .sul-i-bubble-chat-2:before { content: "\f110"; }
98
+ .sul-i-camera-film-1:before { content: "\f111"; }
99
+ .sul-i-check-box-1:before { content: "\f112"; }
100
+ .sul-i-cube:before { content: "\f113"; }
101
+ .sul-i-download-3:before { content: "\f106"; }
102
+ .sul-i-email:before { content: "\f114"; }
103
+ .sul-i-expand-1:before { content: "\f115"; }
104
+ .sul-i-file-music-1:before { content: "\f116"; }
105
+ .sul-i-graph-bar-2:before { content: "\f117"; }
106
+ .sul-i-infomation-circle:before { content: "\f104"; }
107
+ .sul-i-key-2:before { content: "\f118"; }
108
+ .sul-i-layout-4:before { content: "\f119"; }
109
+ .sul-i-layout-none:before { content: "\f11a"; }
110
+ .sul-i-link-3:before { content: "\f107"; }
111
+ .sul-i-list-bullets-1:before { content: "\f11b"; }
112
+ .sul-i-map-pin-1:before { content: "\f11c"; }
113
+ .sul-i-microphone-3:before { content: "\f11d"; }
114
+ .sul-i-mobile-phone-2:before { content: "\f11e"; }
115
+ .sul-i-mouse:before { content: "\f11f"; }
116
+ .sul-i-navigation-drawer-1:before { content: "\f120"; }
117
+ .sul-i-navigation-drawer-2:before { content: "\f121"; }
118
+ .sul-i-navigation-left-2:before { content: "\f122"; }
119
+ .sul-i-network-web:before { content: "\f123"; }
120
+ .sul-i-news-article:before { content: "\f124"; }
121
+ .sul-i-newspaper:before { content: "\f125"; }
122
+ .sul-i-notebook:before { content: "\f126"; }
123
+ .sul-i-person-1:before { content: "\f127"; }
124
+ .sul-i-person-information-1:before { content: "\f128"; }
125
+ .sul-i-picture-2:before { content: "\f129"; }
126
+ .sul-i-plug-1:before { content: "\f12a"; }
127
+ .sul-i-print-text:before { content: "\f12b"; }
128
+ .sul-i-quote-1:before { content: "\f12c"; }
129
+ .sul-i-search:before { content: "\f12d"; }
130
+ .sul-i-share:before { content: "\f105"; }
131
+ .sul-i-transfer-3:before { content: "\f12e"; }
132
+ .sul-i-turntable:before { content: "\f12f"; }
133
+ .sul-i-view-headline:before { content: "\f130"; }
134
+ .sul-i-view-list:before { content: "\f131"; }
135
+ .sul-i-view-module-1:before { content: "\f102"; }
136
+ .sul-i-window-search:before { content: "\f132"; }
137
+ .sul-i-zoom-in:before { content: "\f133"; }
138
+
139
+ $font-sul-icons-arrow-left-3: "\f108";
140
+ $font-sul-icons-arrow-left-8: "\f109";
141
+ $font-sul-icons-arrow-right-3: "\f10a";
142
+ $font-sul-icons-arrow-right-8: "\f10b";
143
+ $font-sul-icons-book-open-4: "\f10c";
144
+ $font-sul-icons-bookmark-all-1: "\f10d";
145
+ $font-sul-icons-books-library: "\f10e";
146
+ $font-sul-icons-box-1: "\f10f";
147
+ $font-sul-icons-bubble-chat-2: "\f110";
148
+ $font-sul-icons-camera-film-1: "\f111";
149
+ $font-sul-icons-check-box-1: "\f112";
150
+ $font-sul-icons-cube: "\f113";
151
+ $font-sul-icons-download-3: "\f106";
152
+ $font-sul-icons-email: "\f114";
153
+ $font-sul-icons-expand-1: "\f115";
154
+ $font-sul-icons-file-music-1: "\f116";
155
+ $font-sul-icons-graph-bar-2: "\f117";
156
+ $font-sul-icons-infomation-circle: "\f104";
157
+ $font-sul-icons-key-2: "\f118";
158
+ $font-sul-icons-layout-4: "\f119";
159
+ $font-sul-icons-layout-none: "\f11a";
160
+ $font-sul-icons-link-3: "\f107";
161
+ $font-sul-icons-list-bullets-1: "\f11b";
162
+ $font-sul-icons-map-pin-1: "\f11c";
163
+ $font-sul-icons-microphone-3: "\f11d";
164
+ $font-sul-icons-mobile-phone-2: "\f11e";
165
+ $font-sul-icons-mouse: "\f11f";
166
+ $font-sul-icons-navigation-drawer-1: "\f120";
167
+ $font-sul-icons-navigation-drawer-2: "\f121";
168
+ $font-sul-icons-navigation-left-2: "\f122";
169
+ $font-sul-icons-network-web: "\f123";
170
+ $font-sul-icons-news-article: "\f124";
171
+ $font-sul-icons-newspaper: "\f125";
172
+ $font-sul-icons-notebook: "\f126";
173
+ $font-sul-icons-person-1: "\f127";
174
+ $font-sul-icons-person-information-1: "\f128";
175
+ $font-sul-icons-picture-2: "\f129";
176
+ $font-sul-icons-plug-1: "\f12a";
177
+ $font-sul-icons-print-text: "\f12b";
178
+ $font-sul-icons-quote-1: "\f12c";
179
+ $font-sul-icons-search: "\f12d";
180
+ $font-sul-icons-share: "\f105";
181
+ $font-sul-icons-transfer-3: "\f12e";
182
+ $font-sul-icons-turntable: "\f12f";
183
+ $font-sul-icons-view-headline: "\f130";
184
+ $font-sul-icons-view-list: "\f131";
185
+ $font-sul-icons-view-module-1: "\f102";
186
+ $font-sul-icons-window-search: "\f132";
187
+ $font-sul-icons-zoom-in: "\f133";
@@ -0,0 +1,52 @@
1
+ /*
2
+ Styles for SulStyles Styleguide
3
+ */
4
+ @import '../sul-styles';
5
+
6
+ @mixin flexcontainer {
7
+ display: flex;
8
+ flex-flow: row wrap;
9
+ }
10
+
11
+ @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);
12
+
13
+ body {
14
+ font-family: 'Source Sans Pro', sans-serif;
15
+ padding: 20px;
16
+ }
17
+
18
+ .color-sample-container {
19
+ @include flexcontainer;
20
+ padding: 12px;
21
+ }
22
+
23
+ .color-sample {
24
+ flex: 0 1 auto;
25
+ margin: 10px;
26
+ text-align: center;
27
+ width: 180px;
28
+ }
29
+
30
+ .color-swatch {
31
+ height: 80px;
32
+ margin-left: 50px;
33
+ margin-right: 50px;
34
+ width: 80px;
35
+ }
36
+
37
+ .icon-container {
38
+ @include flexcontainer;
39
+ padding: 12px;
40
+ }
41
+
42
+ .icon-example-container {
43
+ flex: 0 1 auto;
44
+ padding: 12px;
45
+ text-align: center;
46
+ width: 180px;
47
+ }
48
+
49
+ .icon-example {
50
+ color: $color-black-80;
51
+ font-size: 40px;
52
+ }
@@ -0,0 +1 @@
1
+ @import 'styleguide/styleguide';
@@ -1,4 +1,7 @@
1
- // Stanford Primary Colors from https://identity.stanford.edu/overview/color.html
1
+ /*
2
+ Stanford Primary Colors
3
+ from https://identity.stanford.edu/overview/color.html
4
+ */
2
5
 
3
6
  // Primary Palette
4
7
  $color-cardinal-red: #8c1515;
@@ -1,4 +1,7 @@
1
- // Stanford Web Colors from https://identity.stanford.edu/web-toolkit/color.html
1
+ /*
2
+ Stanford Web Colors
3
+ from https://identity.stanford.edu/web-toolkit/color.html
4
+ */
2
5
 
3
6
  // Red
4
7
  $color-cardinal-red: #8c1515;
@@ -2,4 +2,4 @@
2
2
  @import 'sul-styles/su_web_colors';
3
3
  @import 'sul-styles/su_primary_colors';
4
4
  @import 'sul-icons-rails';
5
- @import 'sul-icons-aliases';
5
+ @import 'sul-icons-aliases';
@@ -0,0 +1,47 @@
1
+ module SulStyles
2
+ class StyleGuideController < ActionController::Base
3
+
4
+ layout 'styleguide'
5
+
6
+ def index
7
+ end
8
+
9
+ def icons
10
+ @icons = []
11
+ @icons << parse_icons("#{SulStyles::Engine.root}/app/assets/stylesheets/_sul-icons-rails.scss")
12
+ @icons << parse_icon_aliases("#{SulStyles::Engine.root}/app/assets/stylesheets/_sul-icons-aliases.scss")
13
+ end
14
+
15
+ def colors
16
+ @colors = []
17
+ @colors << parse_colors("#{SulStyles::Engine.root}/app/assets/stylesheet"\
18
+ 's/sul-styles/su_primary_colors.scss')
19
+ @colors << parse_colors("#{SulStyles::Engine.root}/app/assets/stylesheet"\
20
+ 's/sul-styles/su_web_colors.scss')
21
+ end
22
+
23
+ def parse_colors(file_name)
24
+ file = File.read(file_name)
25
+ {
26
+ title: file.match(/(?<=\/\*\n)(.*)(?=\*\/)/m).to_s,
27
+ colors: file.scan(/^\$.*;$/).map { |c| c.split(':') }
28
+ }
29
+ end
30
+
31
+ def parse_icons(file_name)
32
+ file = File.read(file_name)
33
+ {
34
+ title: 'Icons',
35
+ icons: file.scan(/(?<=\.)(.*)(?=})/).map { |i| i[0].split(':before { content: "\\') }
36
+ }
37
+ end
38
+
39
+ def parse_icon_aliases(file_name)
40
+ file = File.read(file_name)
41
+ {
42
+ title: 'Icon aliases',
43
+ icons: file.scan(/(?<=\.)(.*)(?= {)/)
44
+ }
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Stanford University Libraries - Style Guide</title>
5
+ <%= stylesheet_link_tag 'styleguide', media: 'all', 'data-turbolinks-track' => true %>
6
+ </head>
7
+ <body>
8
+ <h1>Stanford University Libraries - Style Guide</h1>
9
+ <div class='navigation'>
10
+ <ul>
11
+ <li>
12
+ <%= link_to 'Colors', 'colors' %>
13
+ </li>
14
+ <li>
15
+ <%= link_to 'Icons', 'icons' %>
16
+ </li>
17
+ </ul>
18
+ </div>
19
+ <%= yield %>
20
+
21
+ </body>
22
+ </html>
@@ -0,0 +1,18 @@
1
+ <h2>Colors</h2>
2
+ <% @colors.each do |color_group| %>
3
+ <h3><%= color_group[:title] %></h3>
4
+ <div class='color-sample-container'>
5
+ <% color_group[:colors].each do |color| %>
6
+ <div class='color-sample'>
7
+ <div class='color-swatch' style='background-color: <%= color[1] %>'>
8
+ </div>
9
+ <div class='color-variable-name'>
10
+ <%= color[0] %>
11
+ </div>
12
+ <div class='color-name'>
13
+ <%= color[1] %>
14
+ </div>
15
+ </div>
16
+ <% end %>
17
+ </div>
18
+ <% end %>
@@ -0,0 +1,19 @@
1
+ Icons are created using the Streamline icon sets. For maintainability, icons keep their Streamline filename but aliases can also be created for ease of use.
2
+ <% @icons.each do |icon_group| %>
3
+ <h3><%= icon_group[:title] %></h3>
4
+ <div class='icon-container'>
5
+ <% icon_group[:icons].each do |icon| %>
6
+ <div class='icon-example-container'>
7
+ <%= content_tag(:div, '', class: "#{icon[0]} icon-example") %>
8
+ <div class='icon-example-name'>
9
+ <%= icon[0] %>
10
+ </div>
11
+ <% if icon[1].present? %>
12
+ <div class='icon-example-character-code <%= icon[0]%>-char'>
13
+ <%= icon[1].gsub('";', '') %>
14
+ </div>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
18
+ </div>
19
+ <% end %>
File without changes
data/bin/rails ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
+
4
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
+ ENGINE_PATH = File.expand_path('../../lib/sul_styles/engine', __FILE__)
6
+
7
+ # Set up gems listed in the Gemfile.
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
+
11
+ require 'rails/all'
12
+ require 'rails/engine/commands'
@@ -0,0 +1,4 @@
1
+ en:
2
+ date:
3
+ formats:
4
+ day_mon_year: '%d-%b-%Y'
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ SulStyles::Engine.routes.draw do
2
+ root to: 'style_guide#index'
3
+ get 'icons', to: 'style_guide#icons'
4
+ get 'colors', to: 'style_guide#colors'
5
+ end