shipyard-framework 0.5.84 → 0.5.85

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc383fe968d0fe96db0d235903e775a9cff70a849d2090e4e185853e8d277ba1
4
- data.tar.gz: 3956e48a5c285f2cb96e5c71689aaba7cae1d6cd96db3aea2b6a82282db9be26
3
+ metadata.gz: 1c300db6c77b8a5c466db15595b9bb109ce06a1004be92273ba5f04b4607ce78
4
+ data.tar.gz: 7d45bce23826fe11d893783f0104d187ae6a0b76c0ae7028a14ddfe7206d2538
5
5
  SHA512:
6
- metadata.gz: 830ef59a63a920209a562f3017371b62454b2905ccc08c80e8b52fd8c2d62d30736ac5f898b83a08ba0efc7c0461f1b4255b706a3e960fee271434e115649480
7
- data.tar.gz: 553d03d4162905b4492c0b7a35b100096fdd0655be5b975e7eb55dc8ab897e049885f46913ae3a7a398f9d39a33eb24db307a60e3c729716f242326f0d59b190
6
+ metadata.gz: 9a70d9b0ff6c7ce4d0ab46c3d034e1744135f8c32be0666b99e910156297dcbe23d0b82a46cb7784999889c4a46ef66dea9aae21a9f4337812bd6684045f497b
7
+ data.tar.gz: d5e921f1ebed256bc531b5dc9e15d4dc2acf49337f149c99af2fafea63bee46777676c3ff5c47687154f6da630cae6d2bcbf46ab8df5f147330a8f3ea08cb7c0
@@ -1,3 +1,3 @@
1
- <svg class="icon-arrow-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6">
2
2
  <polyline vector-effect="non-scaling-stroke" points="1 1 5 5 9 1" />
3
3
  </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 10">
2
+ <polyline vector-effect="non-scaling-stroke" points="5 1 1 5 5 9" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 10">
2
+ <polyline vector-effect="non-scaling-stroke" points="1 1 5 5 1 9" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6">
2
+ <polyline vector-effect="non-scaling-stroke" points="9 9 5 5 1 9" />
3
+ </svg>
@@ -46,10 +46,16 @@ svg, path, circle, polyline
46
46
  &-lock
47
47
  +width-height(12px, 14px)
48
48
 
49
+ &-arrow-up,
49
50
  &-arrow-down
50
51
  @extend .icon-outline
51
52
  +width-height(10px, 6px)
52
53
 
54
+ &-arrow-left,
55
+ &-arrow-right
56
+ @extend .icon-outline
57
+ +width-height(6px, 10px)
58
+
53
59
  &-check
54
60
  @extend .icon-outline
55
61
  +width-height(8px)
@@ -20,7 +20,7 @@
20
20
  @mixin z-index($value: null)
21
21
  @if $value
22
22
  z-index: $value
23
- @else if $component && map-get($z-index, $component)
23
+ @else if $component and map-get($z-index, $component)
24
24
  z-index: map-get($z-index, $component)
25
25
 
26
26
  @mixin component-styles($modifier)
@@ -1,3 +1,3 @@
1
1
  module Shipyard
2
- VERSION = '0.5.84'
2
+ VERSION = '0.5.85'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- shipyard-framework (0.5.84)
4
+ shipyard-framework (0.5.85)
5
5
  actionview (~> 5.0)
6
6
  sprockets-es6 (~> 0.9.2)
7
7
 
@@ -72,7 +72,7 @@ GEM
72
72
  nokogiri (>= 1.5.9)
73
73
  mercenary (0.3.6)
74
74
  mini_portile2 (2.3.0)
75
- minitest (5.10.3)
75
+ minitest (5.11.1)
76
76
  nokogiri (1.8.1)
77
77
  mini_portile2 (~> 2.3.0)
78
78
  pathutil (0.16.1)
@@ -6,9 +6,9 @@ module Jekyll
6
6
 
7
7
  def render(context)
8
8
  sass = context['site']['sass_output'].detect { |s|
9
- s[:file].include? context['page']['sass_file']
9
+ s['file'].include? context['page']['sass_file']
10
10
  }
11
- sass[:declarations]
11
+ sass['declarations']
12
12
  end
13
13
  end
14
14
  end
@@ -6,9 +6,9 @@ module Jekyll
6
6
 
7
7
  def render(context)
8
8
  sass = context['site']['sass_output'].detect { |s|
9
- s[:file].include? context['page']['sass_file']
9
+ s['file'].include? context['page']['sass_file']
10
10
  }
11
- sass[:selectors]
11
+ sass['selectors']
12
12
  end
13
13
  end
14
14
  end
@@ -6,12 +6,12 @@ module Jekyll
6
6
 
7
7
  def render(context)
8
8
  sass = context['site']['sass_output'].detect { |s|
9
- s[:file].include? context['page']['sass_file']
9
+ s['file'].include? context['page']['sass_file']
10
10
  }
11
- size = sass[:gzip_size]
11
+ size = sass['gzip_size']
12
12
  case
13
- when size >= 1000 then "#{(size / 1000.0).round(1)}kb"
14
- else "#{size}b"
13
+ when size >= 1000 then %(#{(size / 1000.0).round(1)} <span class="text-lightest">kb</span>)
14
+ else %(#{size} <span class="text-lightest">B</span>)
15
15
  end
16
16
  end
17
17
  end
@@ -0,0 +1,12 @@
1
+ module Jekyll
2
+ module HumanSizeFilter
3
+ def number_to_human_size(num, css='text-lightest')
4
+ case
5
+ when num >= 1000 then %(#{(num / 1000.0).round(1)} <span class="#{css}">kb</span>)
6
+ else %(#{num} <span class="#{css}">B</span>)
7
+ end
8
+ end
9
+ end
10
+ end
11
+
12
+ Liquid::Template.register_filter(Jekyll::HumanSizeFilter)
@@ -4,25 +4,41 @@ require 'zlib'
4
4
  module Jekyll
5
5
  class SassOutputGenerator < Generator
6
6
  def generate(site)
7
- site.config['sass_output'] = load_sass_files
7
+ @shipyard_size = 0
8
+ @stylesheets_path = '../assets/stylesheets/'
9
+ sass = load_sass_files
10
+ site.config['sass_output'] = sass
11
+ site.data.merge!(sass_output: sass)
8
12
  end
9
13
 
10
14
  private
11
15
 
12
16
  def load_sass_files
13
- Dir['../assets/stylesheets/shipyard/**/*.sass'].sort.map do |file|
17
+ Dir["#{@stylesheets_path}**/*.sass"].sort.map do |file|
14
18
  sass = %(@import "shipyard/core"\n)
15
19
  sass += File.read(file)
16
20
  compact_css = render(sass, :compact)
17
21
  compressed_css = render(sass, :compressed)
22
+ gzip_size = Zlib::Deflate.deflate(compressed_css).bytesize
23
+
24
+ # Gather all the selectors
25
+ selectors = compressed_css
26
+ .gsub(/({[^{}]*})/, ",\n") # Remove declarations
27
+ .gsub(/@media[^{]*{([^}]*)}/, "\\1") # Remove media queries
28
+ .gsub(/@keyframes[^{]*{[^}]*}/, '') # Remove keyframes
29
+ .gsub(/,([^\n])/, ",\n\\1") # Add new lines
30
+
31
+ @shipyard_size = gzip_size if file.include?('_shipyard.sass')
18
32
  {
19
- file: file,
20
- sass: sass,
21
- compact_css: compact_css,
22
- compressed_css: compressed_css,
23
- gzip_size: Zlib::Deflate.deflate(compressed_css).bytesize,
24
- declarations: compressed_css.scan(/[.][a-zA-Z\-][a-zA-Z0-9\-]*{/).size,
25
- selectors: compressed_css.scan(/[.][a-zA-Z\-][a-zA-Z0-9\-]*/).size
33
+ 'file' => file.gsub(@stylesheets_path, ''),
34
+ 'sass' => sass,
35
+ 'compact_css' => compact_css,
36
+ 'compressed_css' => compressed_css,
37
+ 'selectors' => selectors.scan(/,/).size,
38
+ 'declarations' => compressed_css.scan(/({[^{}]*})/).size,
39
+ 'media_queries' => compressed_css.scan(/@media/).size,
40
+ 'gzip_size' => gzip_size,
41
+ 'percentage' => (gzip_size.to_f / @shipyard_size.to_f * 100.0).round(1)
26
42
  }
27
43
  end
28
44
  end
@@ -6,9 +6,9 @@ module Jekyll
6
6
 
7
7
  def render(context)
8
8
  sass = context['site']['sass_output'].detect { |s|
9
- s[:file].include? context['page']['sass_file']
9
+ s['file'].include? context['page']['sass_file']
10
10
  }
11
- output = sass[:compressed_css]
11
+ output = sass['compressed_css']
12
12
  output.gsub! /}/, " }\n"
13
13
  output.gsub! /{/, ' { '
14
14
  output.gsub! /([a-z]*):/, '\1: '
@@ -20,7 +20,10 @@ The following icons are the most frequently used in just about any application.
20
20
  {% iconitem :card, class: 'center' %}
21
21
  {% iconitem :tag, class: 'center' %}
22
22
  {% iconitem :x, class: 'center' %}
23
+ {% iconitem :arrow_up, class: 'center' %}
23
24
  {% iconitem :arrow_down, class: 'center' %}
25
+ {% iconitem :arrow_left, class: 'center' %}
26
+ {% iconitem :arrow_right, class: 'center' %}
24
27
  {% iconitem :check, class: 'center' %}
25
28
  </ul>
26
29
 
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Shipyard Stats
3
+ ---
4
+
5
+ <table class="table">
6
+ <thead>
7
+ <tr>
8
+ <th>CSS File</th>
9
+ <th>Selectors</th>
10
+ <th>Declarations</th>
11
+ <th>Media Queries</th>
12
+ <th>Size</th>
13
+ <th>%</th>
14
+ </tr>
15
+ </thead>
16
+ {% for sass in site.sass_output -%}
17
+ <tr>
18
+ {% for hash in sass -%}
19
+ {% if hash[0] == 'file' -%}
20
+ <td>
21
+ <a href="https://github.com/codeship/shipyard/blob/master/assets/stylesheets/{{ hash[1] }}" target="_blank" class="strong blue-dark">
22
+ {{ hash[1] }}
23
+ </a>
24
+ </td>
25
+ {% endif -%}
26
+
27
+ {% if hash[0] == 'selectors' -%}
28
+ <td>{{ hash[1] }}</td>
29
+ {% endif -%}
30
+
31
+ {% if hash[0] == 'declarations' -%}
32
+ <td>{{ hash[1] }}</td>
33
+ {% endif -%}
34
+
35
+ {% if hash[0] == 'media_queries' -%}
36
+ <td>{{ hash[1] }}</td>
37
+ {% endif -%}
38
+
39
+ {% if hash[0] == 'gzip_size' -%}
40
+ <td>{{ hash[1] | number_to_human_size }}</td>
41
+ {% endif %}
42
+
43
+ {% if hash[0] == 'percentage' -%}
44
+ <td>{{ hash[1] }}%</td>
45
+ {% endif %}
46
+ {% endfor -%}
47
+ </tr>
48
+ {% endfor -%}
49
+ </table>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipyard-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.84
4
+ version: 0.5.85
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codeship
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-13 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -172,6 +172,9 @@ files:
172
172
  - Rakefile
173
173
  - app/views/shipyard/_alerts.slim
174
174
  - assets/icons/arrows/arrow-down.svg
175
+ - assets/icons/arrows/arrow-left.svg
176
+ - assets/icons/arrows/arrow-right.svg
177
+ - assets/icons/arrows/arrow-up.svg
175
178
  - assets/icons/card.svg
176
179
  - assets/icons/check.svg
177
180
  - assets/icons/gear.svg
@@ -334,6 +337,7 @@ files:
334
337
  - styleguide/_plugins/css_declarations.rb
335
338
  - styleguide/_plugins/css_selectors.rb
336
339
  - styleguide/_plugins/css_size.rb
340
+ - styleguide/_plugins/human_size_filter.rb
337
341
  - styleguide/_plugins/icon_item.rb
338
342
  - styleguide/_plugins/opacity_css_class.rb
339
343
  - styleguide/_plugins/sass_generator.rb
@@ -360,6 +364,7 @@ files:
360
364
  - styleguide/components/tables.md
361
365
  - styleguide/components/tooltips.md
362
366
  - styleguide/index.md
367
+ - styleguide/stats.md
363
368
  - styleguide/utilities/accordion.md
364
369
  - styleguide/utilities/border-radius.md
365
370
  - styleguide/utilities/colors.md
@@ -390,7 +395,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
390
395
  version: '0'
391
396
  requirements: []
392
397
  rubyforge_project:
393
- rubygems_version: 2.7.3
398
+ rubygems_version: 2.7.4
394
399
  signing_key:
395
400
  specification_version: 4
396
401
  summary: A lightweight CSS framework for developing mobile-first projects in Ruby