lato 0.1.9 → 0.1.11
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 +4 -4
- data/app/helpers/lato/components_helper.rb +1 -1
- data/app/views/lato/components/_index.html.erb +1 -1
- data/lib/lato/version.rb +1 -1
- data/lib/tasks/lato_tasks.rake +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bd1de804af1f92a505d96cc38479be01ffa40b0df47057c407f12c927136d93
|
4
|
+
data.tar.gz: b30506ea8583ba135af5a2232530911bdc1e783b058151d6ea7500fd481991c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c58d5ad0c8eb76bb98c6ebbcec616a5f3242527e2a1620a911a49ea1fd9fceb3ef1df64445a45935fb5d7c72947752aed1b84233039b33600f209cf9477472b0
|
7
|
+
data.tar.gz: 54517b2bbad2498725b9174ebddbe352d2a4d3084aef8175e2b33123eea10633d33dfe1e6b628cb1e9d21900037e7dd8b2b47475f887005ed7ed72f6eaa6fc30
|
@@ -75,7 +75,7 @@ module Lato
|
|
75
75
|
# setup classes
|
76
76
|
options[:class] ||= []
|
77
77
|
options[:class].push(classes)
|
78
|
-
options[:class].push('is-invalid')
|
78
|
+
options[:class].push('is-invalid') if form.object && form.object.errors[key] && form.object.errors[key].any?
|
79
79
|
|
80
80
|
# setup stimulus
|
81
81
|
options[:data] ||= {}
|
data/lib/lato/version.rb
CHANGED
data/lib/tasks/lato_tasks.rake
CHANGED
@@ -3,6 +3,7 @@ require 'fileutils'
|
|
3
3
|
namespace :lato do
|
4
4
|
namespace :install do
|
5
5
|
desc 'Install Lato engine and run tasks on main rails application'
|
6
|
+
# Usage: rails lato:install:application
|
6
7
|
task :application do
|
7
8
|
# Copy all "_content.html.erb" parials on layouts/lato from gem to main application
|
8
9
|
##
|
@@ -32,4 +33,26 @@ namespace :lato do
|
|
32
33
|
FileUtils.copy(gem_concern_path, app_concern_path) unless File.exist? app_concern_path
|
33
34
|
end
|
34
35
|
end
|
36
|
+
|
37
|
+
namespace :bootstrap do
|
38
|
+
desc 'Generate SCSS variables for grays starting from a light color'
|
39
|
+
# Usage: rails lato:bootstrap:grays light=ffffff
|
40
|
+
task :grays do
|
41
|
+
light = ENV['light']
|
42
|
+
raise 'Light color not set' if light.blank?
|
43
|
+
|
44
|
+
rgb = light.match(/(..)(..)(..)$/).captures.map(&:hex)
|
45
|
+
r_range = rgb[0] / 9
|
46
|
+
g_range = rgb[1] / 9
|
47
|
+
b_range = rgb[2] / 9
|
48
|
+
|
49
|
+
puts rgb
|
50
|
+
(1..9).each do |level|
|
51
|
+
r_value = rgb[0] - r_range * (level - 1)
|
52
|
+
g_value = rgb[1] - g_range * (level - 1)
|
53
|
+
b_value = rgb[2] - b_range * (level - 1)
|
54
|
+
puts "$gray-#{level}00: rgb(#{r_value}, #{g_value}, #{b_value});"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
35
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|