bullet_train-themes-light 1.6.28 → 1.6.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/light.tailwind.css +2 -1
- data/app/views/themes/light/fields/_field.html.erb +2 -1
- data/lib/bullet_train/themes/light/version.rb +1 -1
- data/lib/tasks/application.rb +12 -1
- data/lib/tasks/bullet_train/themes/light_tasks.rake +5 -0
- data/postcss-import-config.js +15 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3249865a6d7525c33bb201a3212e55173ec05f959f3e9ce122531441b45c1ae
|
4
|
+
data.tar.gz: fed04bc40c2723973cddd09c114626c5d9daa62a08d55f977feb4f25558f137b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecde4d468282e083ebc39999165f635cb413ddcc4ede9d67ec0a7baa897bb4060aa712498380d590c1458910d97a4175090897a7a611b26fe52964e647896c0e
|
7
|
+
data.tar.gz: 89aeccf83b2be5f33032465721b57e533ce268948249fb63176ff97587f20045f02c3e3edf2ccc81f01eb21234ef78280c26a7eb5ddb43a6475a31513f5ac075
|
@@ -30,7 +30,8 @@ end
|
|
30
30
|
errors = [method, method.to_s.gsub(/_id$/, '').to_sym].uniq.map { |attribute| form.object.errors.full_messages_for(attribute) }.flatten
|
31
31
|
has_errors = errors.any? || partial.error? || other_options[:error].present?
|
32
32
|
|
33
|
-
options[:class] = "#{options[:class]} block w-full rounded-md shadow-sm font-light
|
33
|
+
options[:class] = "#{options[:class]} block w-full rounded-md shadow-sm font-light dark:bg-slate-800 dark:text-slate-300"
|
34
|
+
options[:class] += " text-base md:text-sm" # default to 16px on mobile to prevent zooming
|
34
35
|
|
35
36
|
options[:class] += if has_errors
|
36
37
|
" pr-10 border-red-500 text-red-900 placeholder-red-500 outline-none focus:ring-red-500 focus:border-red-500 dark:text-slate-300"
|
data/lib/tasks/application.rb
CHANGED
@@ -3,6 +3,14 @@ require "masamune"
|
|
3
3
|
module BulletTrain
|
4
4
|
module Themes
|
5
5
|
module Application
|
6
|
+
def self.eject_theme_main_css(theme_name)
|
7
|
+
theme_base_path = `bundle show --paths bullet_train-themes-#{theme_name}`.chomp
|
8
|
+
|
9
|
+
puts "Ejecting app/assets/stylesheets/#{theme_name}.tailwind.css."
|
10
|
+
Rails.root.join("app/assets/stylesheets").mkpath
|
11
|
+
`cp -R #{theme_base_path}/app/assets/stylesheets/#{theme_name}.tailwind.css #{Rails.root}/app/assets/stylesheets/#{theme_name}.tailwind.css`
|
12
|
+
end
|
13
|
+
|
6
14
|
def self.eject_theme(theme_name, ejected_theme_name)
|
7
15
|
theme_parts = theme_name.humanize.split.map { |str| str.capitalize }
|
8
16
|
constantized_theme = theme_parts.join
|
@@ -19,7 +27,7 @@ module BulletTrain
|
|
19
27
|
%x(sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/#{theme_name}/#{ejected_theme_name}/g" #{Rails.root}/tailwind.mailer.#{ejected_theme_name}.config.js)
|
20
28
|
|
21
29
|
puts "Ejecting stylesheets into `./app/assets/stylesheets/#{ejected_theme_name}`."
|
22
|
-
|
30
|
+
Rails.root.join("app/assets/stylesheets").mkpath
|
23
31
|
`cp -R #{theme_base_path}/app/assets/stylesheets/#{theme_name} #{Rails.root}/app/assets/stylesheets/#{ejected_theme_name}`
|
24
32
|
`cp -R #{theme_base_path}/app/assets/stylesheets/#{theme_name}.tailwind.css #{Rails.root}/app/assets/stylesheets/#{ejected_theme_name}.tailwind.css`
|
25
33
|
%x(sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/light/#{ejected_theme_name}/g" #{Rails.root}/app/assets/stylesheets/#{ejected_theme_name}.tailwind.css)
|
@@ -27,6 +35,9 @@ module BulletTrain
|
|
27
35
|
puts "Ejecting JavaScript into `./app/javascript/application.#{ejected_theme_name}.js`."
|
28
36
|
`cp #{theme_base_path}/app/javascript/application.#{theme_name}.js #{Rails.root}/app/javascript/application.#{ejected_theme_name}.js`
|
29
37
|
|
38
|
+
puts "Ejecting postcss import aliases configuration into `./postcss-import-config.js`."
|
39
|
+
`cp #{theme_base_path}/postcss-import-config.js #{Rails.root}/postcss-import-config.js`
|
40
|
+
|
30
41
|
`mkdir #{Rails.root}/app/views/themes`
|
31
42
|
|
32
43
|
new_files = {}
|
@@ -3,6 +3,11 @@ require "tasks/application"
|
|
3
3
|
namespace :bullet_train do
|
4
4
|
namespace :themes do
|
5
5
|
namespace :light do
|
6
|
+
desc "Eject the \"Light\" theme's main CSS file."
|
7
|
+
task :eject_css do |task|
|
8
|
+
BulletTrain::Themes::Application.eject_theme_main_css(get_theme_name_from_task(task))
|
9
|
+
end
|
10
|
+
|
6
11
|
desc "Fork the \"Light\" theme into your local repository."
|
7
12
|
task :eject, [:destination] => :environment do |task, args|
|
8
13
|
BulletTrain::Themes::Application.eject_theme(get_theme_name_from_task(task), args[:destination])
|
@@ -0,0 +1,15 @@
|
|
1
|
+
const { execSync } = require("child_process");
|
2
|
+
|
3
|
+
const themeStylesheetsDir = execSync(`bundle exec bin/theme stylesheets-dir ${process.env.THEME} 2> /dev/null`).toString().trim()
|
4
|
+
const themeStylesheet = execSync(`bundle exec bin/theme tailwind-stylesheet ${process.env.THEME} 2> /dev/null`).toString().trim()
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
resolve: (id, basedir, importOptions) => {
|
8
|
+
if (id.startsWith('$ThemeStylesheetsDir')) {
|
9
|
+
id = id.replace('$ThemeStylesheetsDir', themeStylesheetsDir);
|
10
|
+
} else if (id.startsWith('$ThemeStylesheet')) {
|
11
|
+
id = id.replace('$ThemeStylesheet', themeStylesheet);
|
12
|
+
}
|
13
|
+
return id;
|
14
|
+
}
|
15
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-themes-light
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- lib/bullet_train/themes/light/version.rb
|
246
246
|
- lib/tasks/application.rb
|
247
247
|
- lib/tasks/bullet_train/themes/light_tasks.rake
|
248
|
+
- postcss-import-config.js
|
248
249
|
- tailwind.light.config.js
|
249
250
|
- tailwind.mailer.light.config.js
|
250
251
|
homepage: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-themes-light
|