sass-zero 1.5.5 → 1.5.7

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: 20a4635dc3155312bd828d2478b4a7f62d5e4092607399cc59651496ea1645c9
4
- data.tar.gz: 9012ca230804db87095ae41d0603049f4edf0dc8ac42a85900fc10b62ba79bfd
3
+ metadata.gz: 885eb5bf9619462301ed865049ac0caf2647839a2fce0b53b34b0bc88b202b86
4
+ data.tar.gz: 420470581b07731c1e7f0edb87ee1b127dacdc97fc147300142bc4fa59d29ee7
5
5
  SHA512:
6
- metadata.gz: fe008bf485ac16efb61788911c61dbe679ae716f5057ad0c8ae168cfadacffe165f3eac70a51662be831f92277584335a3e8b1e1922ed66721df4fcbb921554e
7
- data.tar.gz: b36e6344702a4ede9a372df8387a22f68afef0937159860cead592226a324f6d67ba5163e61851216965c8c113c6aa13f8557c23a71d0fddbf745d5b7d770aff
6
+ metadata.gz: 0013a6c967fe33f30ac27b9303a04e1597e807787f79e3ddcaca40e65a3fba404c9072174a2346e59171033aca94fa0b3b43dc53560e82f7d4c6b6db16004114
7
+ data.tar.gz: 50ae5a5277cdc0f2b29006fb9a59ad84fc4408f0dae13027bf494325ab3ef551a0b0ea6bef553c59f554b9d563e08ad87a37e06dcadeacba1fc9c699ca070d97
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sass-zero (1.5.5)
4
+ sass-zero (1.5.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -10,10 +10,11 @@ GEM
10
10
 
11
11
  PLATFORMS
12
12
  x86_64-darwin-21
13
+ x86_64-darwin-22
13
14
 
14
15
  DEPENDENCIES
15
16
  rake (~> 13.0)
16
17
  sass-zero!
17
18
 
18
19
  BUNDLED WITH
19
- 2.3.19
20
+ 2.4.19
data/README.md CHANGED
@@ -149,6 +149,10 @@ Instead of using the default variables you can add more or change the existents,
149
149
  ...
150
150
  ```
151
151
 
152
+ ## Scaffold
153
+
154
+ When executing `rails scaffold` the generator will use built-in optimized templates.
155
+
152
156
  ## References
153
157
 
154
158
  [The 35 CSS properties you must know to do 80% of the work](https://github.com/lazaronixon/css-properties-counter)
data/example.html CHANGED
@@ -1,4 +1,4 @@
1
- <main class="container container--lg" style="background: var(--color-bg--surface);">
1
+ <main class="container container--lg" style="background: white; min-height: 100vh;">
2
2
  <div class="push-md--bottom">
3
3
  <div class="push-sm--bottom">
4
4
  <p>The base type is 1rem (16px) over 1.4 line height</p>
@@ -0,0 +1,9 @@
1
+ require "rails/generators/erb/controller/controller_generator"
2
+
3
+ module SassZero
4
+ module Generators
5
+ class ControllerGenerator < Erb::Generators::ControllerGenerator
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ <div>
2
+ <h1><%= class_name %>#<%= @action %></h1>
3
+ <p>Find me in <%= @path %></p>
4
+ </div>
@@ -0,0 +1,9 @@
1
+ require "rails/generators/erb/mailer/mailer_generator"
2
+
3
+ module SassZero
4
+ module Generators
5
+ class MailerGenerator < Erb::Generators::MailerGenerator
6
+ source_root File.expand_path("../templates", __FILE__)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ <h1><%= class_name %>#<%= @action %></h1>
2
+
3
+ <p>
4
+ <%%= @greeting %>, find me in <%= @path %>
5
+ </p>
@@ -0,0 +1,3 @@
1
+ <%= class_name %>#<%= @action %>
2
+
3
+ <%%= @greeting %>, find me in <%= @path %>
@@ -0,0 +1,34 @@
1
+ require "rails/generators/erb/scaffold/scaffold_generator"
2
+ require "rails/generators/resource_helpers"
3
+
4
+ module SassZero
5
+ module Generators
6
+ class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
7
+ include Rails::Generators::ResourceHelpers
8
+
9
+ source_root File.expand_path("../templates", __FILE__)
10
+
11
+ argument :attributes, type: :array, default: [], banner: "field:type field:type"
12
+
13
+ def create_root_folder
14
+ empty_directory File.join("app/views", controller_file_path)
15
+ end
16
+
17
+ def copy_view_files
18
+ available_views.each do |view|
19
+ formats.each do |format|
20
+ filename = filename_with_extensions(view, format)
21
+ template filename, File.join("app/views", controller_file_path, filename)
22
+ end
23
+ end
24
+
25
+ template "partial.html.erb", File.join("app/views", controller_file_path, "_#{singular_name}.html.erb")
26
+ end
27
+
28
+ private
29
+ def available_views
30
+ %w(index edit show new _form)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,35 @@
1
+ <%%= form_with(model: <%= model_resource_name %>) do |form| %>
2
+ <%% if <%= singular_table_name %>.errors.any? %>
3
+ <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
4
+
5
+ <ul class="list--unindented">
6
+ <%% <%= singular_table_name %>.errors.each do |error| %>
7
+ <li><%%= error.full_message %></li>
8
+ <%% end %>
9
+ </ul>
10
+ <%% end %>
11
+
12
+ <% attributes.each do |attribute| -%>
13
+ <div>
14
+ <% if attribute.password_digest? -%>
15
+ <%%= form.label :password, class: "u-display-b txt--bold push-xs--bottom" %>
16
+ <%%= form.password_field :password, class: "input" %>
17
+ </div>
18
+
19
+ <div>
20
+ <%%= form.label :password_confirmation, class: "u-display-b txt--bold push-xs--bottom" %>
21
+ <%%= form.password_field :password_confirmation, class: "input" %>
22
+ <% elsif attribute.attachments? -%>
23
+ <%%= form.label :<%= attribute.column_name %>, class: "u-display-b txt--bold push-xs--bottom" %>
24
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "input" %>
25
+ <% else -%>
26
+ <%%= form.label :<%= attribute.column_name %>, class: "u-display-b txt--bold push-xs--bottom" %>
27
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "input" %>
28
+ <% end -%>
29
+ </div>
30
+
31
+ <% end -%>
32
+ <div>
33
+ <%%= form.submit class: "btn btn--primary" %>
34
+ </div>
35
+ <%% end %>
@@ -0,0 +1,8 @@
1
+ <h1>Editing <%= human_name.downcase %></h1>
2
+
3
+ <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
4
+
5
+ <div class="push-md--top">
6
+ <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "btn btn--secondary" %>
7
+ <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn btn--secondary" %>
8
+ </div>
@@ -0,0 +1,14 @@
1
+ <p class="txt--bold align--center"><%%= notice %></p>
2
+
3
+ <h1><%= human_name.pluralize %></h1>
4
+
5
+ <div id="<%= plural_table_name %>" class="push-md--bottom">
6
+ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
7
+ <%%= render <%= singular_table_name %> %>
8
+ <p>
9
+ <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "btn btn--secondary" %>
10
+ </p>
11
+ <%% end %>
12
+ </div>
13
+
14
+ <%%= link_to "New <%= human_name.downcase %>", <%= new_helper(type: :path) %>, class: "btn btn--primary" %>
@@ -0,0 +1,7 @@
1
+ <h1>New <%= human_name.downcase %></h1>
2
+
3
+ <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
4
+
5
+ <div class="push-md--top">
6
+ <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn btn--secondary" %>
7
+ </div>
@@ -0,0 +1,17 @@
1
+ <div id="<%%= dom_id <%= singular_name %> %>">
2
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
3
+ <p class="push-sm--bottom">
4
+ <strong><%= attribute.human_name %>:</strong>
5
+ <% if attribute.attachment? -%>
6
+ <%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %> if <%= singular_name %>.<%= attribute.column_name %>.attached? %>
7
+ <% elsif attribute.attachments? -%>
8
+ <%% <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
9
+ <div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></div>
10
+ <%% end %>
11
+ <% else -%>
12
+ <%%= <%= singular_name %>.<%= attribute.column_name %> %>
13
+ <% end -%>
14
+ </p>
15
+
16
+ <% end -%>
17
+ </div>
@@ -0,0 +1,12 @@
1
+ <p class="txt--bold align--center"><%%= notice %></p>
2
+
3
+ <%%= render @<%= singular_table_name %> %>
4
+
5
+ <div>
6
+ <div class="push-md--bottom">
7
+ <%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "btn btn--primary" %>
8
+ <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn btn--secondary" %>
9
+ </div>
10
+
11
+ <%%= link_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, "data-turbo-method": :delete, "data-turbo-confirm": "Are you sure?", class: "btn btn--secondary" %>
12
+ </div>
data/lib/sass-zero.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  require "sass_zero/version"
2
2
 
3
3
  module SassZero
4
- class Engine < ::Rails::Engine; end
4
+ class Engine < ::Rails::Engine
5
+ config.app_generators do |g|
6
+ g.template_engine :sass_zero
7
+ end
8
+ end
5
9
  end
@@ -1,5 +1,5 @@
1
1
  module Sass
2
2
  module Zero
3
- VERSION = "1.5.5"
3
+ VERSION = "1.5.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.5
4
+ version: 1.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - lazaronixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-16 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -60,6 +60,18 @@ files:
60
60
  - app/assets/stylesheets/sass-zero/variables/_width.scss
61
61
  - app/assets/stylesheets/sass-zero/variables/_zindex.scss
62
62
  - example.html
63
+ - lib/generators/sass_zero/controller/controller_generator.rb
64
+ - lib/generators/sass_zero/controller/templates/view.html.erb.tt
65
+ - lib/generators/sass_zero/mailer/mailer_generator.rb
66
+ - lib/generators/sass_zero/mailer/templates/view.html.erb.tt
67
+ - lib/generators/sass_zero/mailer/templates/view.text.erb.tt
68
+ - lib/generators/sass_zero/scaffold/scaffold_generator.rb
69
+ - lib/generators/sass_zero/scaffold/templates/_form.html.erb.tt
70
+ - lib/generators/sass_zero/scaffold/templates/edit.html.erb.tt
71
+ - lib/generators/sass_zero/scaffold/templates/index.html.erb.tt
72
+ - lib/generators/sass_zero/scaffold/templates/new.html.erb.tt
73
+ - lib/generators/sass_zero/scaffold/templates/partial.html.erb.tt
74
+ - lib/generators/sass_zero/scaffold/templates/show.html.erb.tt
63
75
  - lib/sass-zero.rb
64
76
  - lib/sass_zero.rb
65
77
  - lib/sass_zero/version.rb
@@ -85,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
97
  - !ruby/object:Gem::Version
86
98
  version: '0'
87
99
  requirements: []
88
- rubygems_version: 3.3.7
100
+ rubygems_version: 3.4.10
89
101
  signing_key:
90
102
  specification_version: 4
91
103
  summary: A CSS framework for custom UI development.