codefabrik-styleguide 0.1.13 → 0.1.15

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: 0aa2182a9a3fadb921a4ea5c1da23d96852e875712a509edc643d4b1455504f1
4
- data.tar.gz: '0618e440b1c133db6f0ebb0c511f7d2c6cf78db44984908e79c573b28f1842e2'
3
+ metadata.gz: 6e3e184a55f9d67e811a5cac85147bb4652847924f6b43aea1609136a48e6d6f
4
+ data.tar.gz: 86eddb3fdf9f6a63f886d57e6bf010a2dccb5acd9a651c9d72de80494af3b035
5
5
  SHA512:
6
- metadata.gz: c118d78fbe37dbb51e3dd5d8b8b0f13d5b17f795187cfcee982338dcc54f805d20ca7e15e82c7b02375496bc84403c5049dad945390e0bda2fc4fb4476f4e3e9
7
- data.tar.gz: 171c062498328ca33b76f6e5430fea0eee0e395c5f46a9ce8ab3c348d7dfa56ecdcc37c31bd801826759d50caa46acdfdff6499bb268aec0374ca713fcc2599f
6
+ metadata.gz: 10f346ae40d2b2a7d2ec469bd4d0a14b873334f9bb96cee19007ab977b8e9556a14f3f65fb1db370f7f31759fbc6ffa074477920e24920269832968ae0a7a500
7
+ data.tar.gz: f10bb0507aba5c9fd72ede67bed6bfa7d514aa0b29c6e8bf350b02bb1a4f0af1ab9154a86815d3eb6921dc43400cb9064343404885c8e8941d93f7ce338859d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codefabrik-styleguide (0.1.13)
4
+ codefabrik-styleguide (0.1.15)
5
5
  dartsass-rails (>= 0.4.0)
6
6
  rails (>= 6.0)
7
7
  sassc (>= 2.4.0)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Codefabrik
4
4
  module Styleguide
5
- VERSION = "0.1.13"
5
+ VERSION = "0.1.15"
6
6
  end
7
7
  end
@@ -0,0 +1,42 @@
1
+ module Codefabrik
2
+ module Styleguide
3
+ module ViewHelpers
4
+ def breadcrumbs(links, current)
5
+ output = "<div class='breadcrumbs mb-1'>"
6
+ links.each do |link|
7
+ output << "#{link}<span class='separator'>&#9654;</span>"
8
+ end
9
+ output << current
10
+ output << "</div>"
11
+ output.html_safe
12
+ end
13
+
14
+ def table(headers, data)
15
+ output = "<div class='table'><div class='thead'><div class='tr'>"
16
+ headers.each do |header|
17
+ output << "<div class='th'>#{header}</div>"
18
+ end
19
+ output << "</div></div><div class='tbody'>"
20
+ data.each do |row|
21
+ output << "<div class='tr'>"
22
+ row.each do |cell|
23
+ output << "<div class='td'>#{cell}</div>"
24
+ end
25
+ output << "</div>"
26
+ end
27
+ output << "</div></div>"
28
+ output.html_safe
29
+ end
30
+
31
+ def active_link_to(label, path, options = {})
32
+ if request.path == path
33
+ existing_klass = options[:klass] || ''
34
+ new_klass = "#{existing_klass} active"
35
+ link_to(label, path, options.merge({ class: new_klass }))
36
+ else
37
+ link_to(label, path, options)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rails/engine"
4
+ require_relative "styleguide/view_helpers"
4
5
  require_relative "styleguide/version"
5
6
 
6
7
  module Codefabrik
@@ -8,6 +9,9 @@ module Codefabrik
8
9
  class Error < StandardError; end
9
10
 
10
11
  class Engine < ::Rails::Engine
12
+ initializer "styleguide.view_helpers" do
13
+ ActiveSupport.on_load( :action_view ){ include Codefabrik::Styleguide::ViewHelpers }
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -72,7 +72,11 @@ header, footer {
72
72
  top: 0;
73
73
  padding: 0;
74
74
  padding-top: $default_distance;
75
- background-color: transparent;
75
+ background-color: map-get($primary, 400);
76
+
77
+ @media (prefers-color-scheme: dark) {
78
+ background-color: map-get($dark, 400);
79
+ }
76
80
 
77
81
  section {
78
82
  display: flex;
@@ -91,11 +95,11 @@ header, footer {
91
95
  &.active {
92
96
  border-left: 0.25 * $default_distance solid map-get($primary, 100);
93
97
  border-bottom: none;
94
- background-color: map-get($primary, 400);
98
+ background-color: map-get($primary, 600);
95
99
  }
96
100
 
97
101
  &:hover {
98
- background-color: map-get($primary, 400);
102
+ background-color: map-get($primary, 100);
99
103
  }
100
104
  }
101
105
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codefabrik-styleguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-28 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dartsass-rails
@@ -84,6 +84,7 @@ files:
84
84
  - dist/.gitkeep
85
85
  - lib/codefabrik/styleguide.rb
86
86
  - lib/codefabrik/styleguide/version.rb
87
+ - lib/codefabrik/styleguide/view_helpers.rb
87
88
  - sig/codefabrik/styleguide.rbs
88
89
  - vendor/assets/stylesheets/codefabrik/styleguide.scss
89
90
  - vendor/assets/stylesheets/codefabrik/styleguide/01_reset.scss