a generator to move the styles to app
This commit is contained in:
parent
75915b3fe2
commit
924eb6317c
@ -1,19 +1,2 @@
|
|||||||
@import "./tailwind_base.css";
|
@import "./tailwind_base.css";
|
||||||
@import "./merged/tailwind_styles.css";
|
@import "./merged_tailwind_styles.css";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@layer components {
|
|
||||||
.button {
|
|
||||||
@apply inline-block rounded-lg px-3 py-2 text-base font-medium border border-gray-500 hover:border-black;
|
|
||||||
}
|
|
||||||
.change {
|
|
||||||
@apply bg-cyan-200;
|
|
||||||
}
|
|
||||||
.remove {
|
|
||||||
@apply bg-red-200;
|
|
||||||
}
|
|
||||||
.action {
|
|
||||||
@apply bg-green-200;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -2059,16 +2059,16 @@ select {
|
|||||||
border-color: rgb(243 244 246 / var(--tw-border-opacity));
|
border-color: rgb(243 244 246 / var(--tw-border-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-gray-200 {
|
|
||||||
--tw-border-opacity: 1;
|
|
||||||
border-color: rgb(229 231 235 / var(--tw-border-opacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-slate-400 {
|
.border-slate-400 {
|
||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(148 163 184 / var(--tw-border-opacity));
|
border-color: rgb(148 163 184 / var(--tw-border-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.border-gray-200 {
|
||||||
|
--tw-border-opacity: 1;
|
||||||
|
border-color: rgb(229 231 235 / var(--tw-border-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
.border-green-500 {
|
.border-green-500 {
|
||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(34 197 94 / var(--tw-border-opacity));
|
border-color: rgb(34 197 94 / var(--tw-border-opacity));
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
.prose {
|
|
||||||
max-width: 100%;
|
|
||||||
color: inherit;
|
|
||||||
--tw-prose-bullets: #6b7280;
|
|
||||||
--tw-prose-headings: inherit;
|
|
||||||
}
|
|
21
app/assets/stylesheets/merged_tailwind_styles.css
Normal file
21
app/assets/stylesheets/merged_tailwind_styles.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.prose {
|
||||||
|
max-width: 100%;
|
||||||
|
color: inherit;
|
||||||
|
--tw-prose-bullets: #6b7280;
|
||||||
|
--tw-prose-headings: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.button {
|
||||||
|
@apply inline-block rounded-lg px-3 py-2 text-base font-medium border border-gray-500 hover:border-black;
|
||||||
|
}
|
||||||
|
.change {
|
||||||
|
@apply bg-cyan-200;
|
||||||
|
}
|
||||||
|
.remove {
|
||||||
|
@apply bg-red-200;
|
||||||
|
}
|
||||||
|
.action {
|
||||||
|
@apply bg-green-200;
|
||||||
|
}
|
||||||
|
}
|
13
lib/generators/install/USAGE
Normal file
13
lib/generators/install/USAGE
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Description:
|
||||||
|
Install merged, create dirs, copy initial empty data
|
||||||
|
NOT done
|
||||||
|
|
||||||
|
Example:
|
||||||
|
bin/rails generate merged:install
|
||||||
|
|
||||||
|
This will create:
|
||||||
|
/merged directory for your data
|
||||||
|
/merged/*yml empty data files
|
||||||
|
/app/assets/images/cms for your images
|
||||||
|
/app/assets/stylesheets/merged/tailwind_extra.css
|
||||||
|
|
9
lib/generators/install/install_generator.rb
Normal file
9
lib/generators/install/install_generator.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
require "rails/generators"
|
||||||
|
|
||||||
|
module Merged
|
||||||
|
module Generators
|
||||||
|
class InstallGenerator < Rails::Generators::Base
|
||||||
|
source_root File.expand_path("templates", __dir__)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
16
lib/generators/merged/update/USAGE
Normal file
16
lib/generators/merged/update/USAGE
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Description:
|
||||||
|
Update an existing installation
|
||||||
|
Basically copy the merged tailwind stylesheet over to the app.
|
||||||
|
To use in a tailwind app you must split out the
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
into it's own file, and have the main entry point only include
|
||||||
|
the base, this merged file and your own. (Because sprockets etc is not
|
||||||
|
available and the tailwind cli only supports top level includes)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
bin/rails generate merged:update
|
||||||
|
|
||||||
|
This will overwrite:
|
||||||
|
/app/assets/stylesheets/merged/tailwind_extra.css
|
11
lib/generators/merged/update/update_generator.rb
Normal file
11
lib/generators/merged/update/update_generator.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
require 'rails/generators/base'
|
||||||
|
|
||||||
|
module Merged
|
||||||
|
class UpdateGenerator < Rails::Generators::Base
|
||||||
|
source_root File.expand_path("../../../../app/assets/stylesheets", __dir__)
|
||||||
|
|
||||||
|
def update
|
||||||
|
copy_file "merged_tailwind_styles.css", "app/assets/stylesheets/merged_tailwind_styles.css"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -1,8 +1,18 @@
|
|||||||
require "merged/version"
|
require "merged/version"
|
||||||
require "merged/engine"
|
require "merged/engine"
|
||||||
|
require "generators/install/install_generator"
|
||||||
|
require "generators/merged/update/update_generator"
|
||||||
|
|
||||||
module Merged
|
module Merged
|
||||||
|
|
||||||
|
# Directory inside the app/assets/images
|
||||||
|
mattr_accessor :image_path
|
||||||
|
@@image_path = "cms"
|
||||||
|
|
||||||
|
# directory in root to store data
|
||||||
|
mattr_accessor :data_path
|
||||||
|
@@image_path = "merged"
|
||||||
|
|
||||||
def self.load_data
|
def self.load_data
|
||||||
# pre-load data
|
# pre-load data
|
||||||
[OptionDefinition, CardStyle, SectionStyle , PageStyle,
|
[OptionDefinition, CardStyle, SectionStyle , PageStyle,
|
||||||
|
@ -9,6 +9,8 @@ require "merged/shared_helper"
|
|||||||
module Merged
|
module Merged
|
||||||
class Engine < ::Rails::Engine
|
class Engine < ::Rails::Engine
|
||||||
isolate_namespace Merged
|
isolate_namespace Merged
|
||||||
|
config.merged = Merged
|
||||||
|
|
||||||
initializer "merged.assets.precompile" do |app|
|
initializer "merged.assets.precompile" do |app|
|
||||||
app.config.assets.precompile += %w( merged/merged.css
|
app.config.assets.precompile += %w( merged/merged.css
|
||||||
merged/home merged/merged_logo)
|
merged/home merged/merged_logo)
|
||||||
|
Loading…
Reference in New Issue
Block a user