lato 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- 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: 7ab1d90b203dab6864e4120b6b3dd3ff44bb42c5b42b54fba70e55f982bb260b
|
4
|
+
data.tar.gz: 676844d4597c20a7cb64cbaba297ccb55c4c0421b85da981e0fa94919ac2525b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b97a95b0b51722a8416083779d2fa6ee3f87445c36c366fb0ab25659d7d84c65db470c939884ea75755bcbe8cd26669d86919128908d507f24a1e7ed5f59800
|
7
|
+
data.tar.gz: 90bedf8377b7d4ba09de99d9fd8653239efdf3d53e0b633c9cba3c0680df7b6d22356addbdcbe7845cebac81e8cf75506b97f76d3dfd00af5784a76b424b5cdb
|
@@ -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&.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.10
|
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
|