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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92d512245037704ff364d01fcf316cf114677b4dcf2ec487f1c0423a58a42562
4
- data.tar.gz: cfe5526f94a5595c27b95b4c6d4ec59a7e1af30689a2cc64a96e9a01ef115097
3
+ metadata.gz: 7ab1d90b203dab6864e4120b6b3dd3ff44bb42c5b42b54fba70e55f982bb260b
4
+ data.tar.gz: 676844d4597c20a7cb64cbaba297ccb55c4c0421b85da981e0fa94919ac2525b
5
5
  SHA512:
6
- metadata.gz: 7c4c8d773c626d1d82f27fa0f40065cccf822a8c77b24a8b8509379da0c1afabdf2b488c515892e464e695e16d8a68afd2ca9fb808c28eba75e44a967865287b
7
- data.tar.gz: 6695fa93944e55adc432f0fe2da98f1dd000bce6063ace5fbb3a80533d3bdbb2b45764a002fa4ddb22757382d3f28b9523c36470a6fd800fe46cff84a8c0e588
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') unless form.object.errors[key].blank?
78
+ options[:class].push('is-invalid') if form.object&.errors[key]&.any?
79
79
 
80
80
  # setup stimulus
81
81
  options[:data] ||= {}
@@ -4,7 +4,7 @@
4
4
  <%= hidden_field_tag :key, key %>
5
5
  <%= hidden_field_tag :sort_by, params[:sort_by] %>
6
6
 
7
- <% if false && browser.device.mobile? %>
7
+ <% if browser.device.mobile? %>
8
8
 
9
9
  <p>Work in progress</p>
10
10
 
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
@@ -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.9
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-28 00:00:00.000000000 Z
11
+ date: 2022-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails