sass-zero 1.5.4 → 1.5.6

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: 819ee10fcdc7c6190a904642b9b406bb6730bc5f30e9547f578035797ebe5915
4
- data.tar.gz: 01d88de63904e41e58d83ca2a8c598e85483f1d913d5ecdac61ee67a97d57ceb
3
+ metadata.gz: 7e05210df420b72af03bde0d380dad76041246e6304997ce614270f564eb5846
4
+ data.tar.gz: 07c54772c8aaf2367c137789cc918f397b593bfa41d1d966dfa18a3f88af1cc2
5
5
  SHA512:
6
- metadata.gz: ec5d2fd0707b6afbadfad46667f9c5b4f440a2dd41c8864bbb80a35bc8abb75fa143264b1aff1868c5bc68756567cbcdd26b430c932e4b68f1e7b861dfc3fab8
7
- data.tar.gz: 7ea45d764ff03adf83c3849dfdd1f6786a80264955033171e33b76747c01b39e9fc8199e90509ee9f97db676431549bb198dde46157f82829ef9e5bc5bea6b45
6
+ metadata.gz: 644afa28ddd85b970ca33b28dd779437a947606beacc91cf02f59fa32af2ab2a3a427435772eed0d82873d73624feb63e0d46908ac822e3683ecd6e661e604ef
7
+ data.tar.gz: e161154b18437de29005763f45cbbcd8887279af2d2881c2ce7271a129f78b7ef377d5ad4d11be28cc79c32bea7b47c410f6b8c58c1c290bc9a18a566c5b4bac
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sass-zero (1.5.4)
4
+ sass-zero (1.5.6)
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)
@@ -99,14 +99,6 @@ html {
99
99
  }
100
100
  }
101
101
 
102
- .dropdown {
103
- background-color: var(--color-bg--surface);
104
- border-width: $border; border-radius: $radius-primary;
105
- padding: $size-4;
106
- position: absolute;
107
- z-index: $z-10;
108
- }
109
-
110
102
  [type="checkbox"], [type="radio"] {
111
103
  transform: scale(1.36); margin: $size-1;
112
104
  }
@@ -189,7 +181,6 @@ dialog {
189
181
  background-color: var(--color-bg--surface);
190
182
  border-width: $border; border-radius: $radius-primary;
191
183
  padding: $size-4;
192
- box-shadow: $shadow-lg;
193
184
  color: inherit;
194
185
  }
195
186
 
@@ -197,18 +188,6 @@ dialog::backdrop {
197
188
  background-color: rgba($gray-500, $opacity-75);
198
189
  }
199
190
 
200
- details {
201
- display: inline-block;
202
- }
203
-
204
- summary {
205
- list-style: none;
206
- }
207
-
208
- summary::-webkit-details-marker {
209
- display: none;
210
- }
211
-
212
191
  table {
213
192
  width: $w-full;
214
193
  }
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>
@@ -30,17 +30,6 @@
30
30
 
31
31
  <input type="submit" value="Submit Button" class="btn btn--secondary" />
32
32
 
33
- <details class="u-position-context">
34
- <summary class="btn btn--secondary">Dropdown Button</summary>
35
- <div class="dropdown push-xs--top u-position--right">
36
- <ul class="list--unbulleted u-nowrap flush">
37
- <li>Unordered list item 1</li>
38
- <li>Unordered list item 2</li>
39
- <li>Unordered list item 3</li>
40
- </ul>
41
- </div>
42
- </details>
43
-
44
33
  <button class="btn btn--secondary"><span class="btn__icon bx bx-plus"></span> Icon Button</button>
45
34
  <button class="btn btn--secondary btn--small">Small Button</button>
46
35
  </div>
@@ -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,16 @@
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
+ <article class="push-lg--bottom">
8
+ <%%= render <%= singular_table_name %> %>
9
+ <p>
10
+ <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "btn btn--secondary" %>
11
+ </p>
12
+ </article>
13
+ <%% end %>
14
+ </div>
15
+
16
+ <%%= 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.4"
3
+ VERSION = "1.5.6"
4
4
  end
5
5
  end
data/screenshot-dark.png CHANGED
Binary file
Binary file
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.4
4
+ version: 1.5.6
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-15 00:00:00.000000000 Z
11
+ date: 2023-09-03 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.