sass-zero 1.5.5 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -2
- data/README.md +4 -0
- data/example.html +1 -1
- data/lib/generators/sass_zero/controller/controller_generator.rb +9 -0
- data/lib/generators/sass_zero/controller/templates/view.html.erb.tt +4 -0
- data/lib/generators/sass_zero/mailer/mailer_generator.rb +9 -0
- data/lib/generators/sass_zero/mailer/templates/view.html.erb.tt +5 -0
- data/lib/generators/sass_zero/mailer/templates/view.text.erb.tt +3 -0
- data/lib/generators/sass_zero/scaffold/scaffold_generator.rb +34 -0
- data/lib/generators/sass_zero/scaffold/templates/_form.html.erb.tt +35 -0
- data/lib/generators/sass_zero/scaffold/templates/edit.html.erb.tt +8 -0
- data/lib/generators/sass_zero/scaffold/templates/index.html.erb.tt +16 -0
- data/lib/generators/sass_zero/scaffold/templates/new.html.erb.tt +7 -0
- data/lib/generators/sass_zero/scaffold/templates/partial.html.erb.tt +17 -0
- data/lib/generators/sass_zero/scaffold/templates/show.html.erb.tt +12 -0
- data/lib/sass-zero.rb +5 -1
- data/lib/sass_zero/version.rb +1 -1
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e05210df420b72af03bde0d380dad76041246e6304997ce614270f564eb5846
|
4
|
+
data.tar.gz: 07c54772c8aaf2367c137789cc918f397b593bfa41d1d966dfa18a3f88af1cc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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.
|
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:
|
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,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
data/lib/sass_zero/version.rb
CHANGED
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
|
+
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-
|
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.
|
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.
|