codefabrik-styleguide 0.1.13 → 0.1.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e3e184a55f9d67e811a5cac85147bb4652847924f6b43aea1609136a48e6d6f
|
4
|
+
data.tar.gz: 86eddb3fdf9f6a63f886d57e6bf010a2dccb5acd9a651c9d72de80494af3b035
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10f346ae40d2b2a7d2ec469bd4d0a14b873334f9bb96cee19007ab977b8e9556a14f3f65fb1db370f7f31759fbc6ffa074477920e24920269832968ae0a7a500
|
7
|
+
data.tar.gz: f10bb0507aba5c9fd72ede67bed6bfa7d514aa0b29c6e8bf350b02bb1a4f0af1ab9154a86815d3eb6921dc43400cb9064343404885c8e8941d93f7ce338859d2
|
data/Gemfile.lock
CHANGED
@@ -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'>▶</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:
|
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,
|
98
|
+
background-color: map-get($primary, 600);
|
95
99
|
}
|
96
100
|
|
97
101
|
&:hover {
|
98
|
-
background-color: map-get($primary,
|
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.
|
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:
|
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
|