material_design 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd9141b530a620f3aaaaa7ccefe6aa219846bba10006632e99213950af7d00e0
4
- data.tar.gz: 31769ef76c245109501d8ec92ff7c24de88a77c494487eb62a42c3622818ed6d
3
+ metadata.gz: a395e476f7ce240031115c90e6b7433707ab31099300d2afdb862a53dbd2cc50
4
+ data.tar.gz: ca2ffa3f1ba4ed05bd9eb903a35f1cdc3062559d22ee25e51d946cb52d00095a
5
5
  SHA512:
6
- metadata.gz: 29e92b249692d64c8a0728aed70fa195293fd15f445e21b79c3506bdb72015a7bea203f6eda47d6411e7e8aa009a7b0926f46b341506edc3c33f69f638894e35
7
- data.tar.gz: 9e609de49588e87bc841b11aa4cbb0e09a3b6db3c9f19271d55aa51001d3eceb0553b69f0724733032b993f2bbdbcc7354a03d2c69ab4ae253390cabcea4cebd
6
+ metadata.gz: be0f09f5aa904d67780ffb04683eb3026ebda7b0caed451bde8f231e1c15ca75eb64b8ce8e671bb5ba8ddf0effaf90bad9ef19410725a2f7ef161fbba54bcaf6
7
+ data.tar.gz: 7bb2c757ea4a032679c6170f5185318360e042d206c7e5ecd72ac4b7ac61285c6f59280e38ea8e4d2fe6156b498b38269af6b3d7a47da3db853161ea87861c41
@@ -1,7 +1,11 @@
1
1
  :root {
2
2
  /* color-scheme: light dark; */
3
- --md-sys-light-state-hover-state-layer-opacity: 0.08;
4
- --md-sys-dark-state-hover-state-layer-opacity: 0.08;
3
+ --md-sys-light-state-hover-state-layer-opacity: 0.12;
4
+ --md-sys-dark-state-hover-state-layer-opacity: 0.12;
5
+ --md-sys-light-state-pressed-state-layer-opacity: 0.24;
6
+ --md-sys-dark-state-pressed-state-layer-opacity: 0.24;
7
+ --md-sys-light-state-disabled-state-layer-opacity: 0.38;
8
+ --md-sys-dark-state-disabled-state-layer-opacity: 0.38;
5
9
 
6
10
  /* Light scheme */
7
11
  --md-sys-light-primary: 101 85 143;
@@ -1,4 +1,188 @@
1
+ @media (prefers-color-scheme: light) {
2
+ :root {
3
+ --md-sys-tonal-hover-layer-state: rgb(var(--md-sys-light-on-secondary-container) / var(--md-sys-light-state-hover-state-layer-opacity));
4
+ --md-sys-tonal-pressed-layer-state: rgb(var(--md-sys-light-on-secondary-container) / var(--md-sys-light-state-pressed-state-layer-opacity));
5
+ --md-sys-filled-hover-layer-state: rgb(var(--md-sys-light-on-primary) / var(--md-sys-light-state-hover-state-layer-opacity));
6
+ --md-sys-filled-pressed-layer-state: rgb(var(--md-sys-light-on-primary) / var(--md-sys-light-state-pressed-state-layer-opacity));
7
+ --md-sys-outlined-hover-layer-state: rgb(var(--md-sys-light-primary) / var(--md-sys-light-state-hover-state-layer-opacity));
8
+ --md-sys-outlined-pressed-layer-state: rgb(var(--md-sys-light-primary) / var(--md-sys-light-state-pressed-state-layer-opacity));
9
+ }
10
+ }
11
+
12
+ @media (prefers-color-scheme: dark) {
13
+ :root {
14
+ --md-sys-tonal-hover-layer-state: rgb(var(--md-sys-dark-on-secondary-container) / var(--md-sys-dark-state-hover-state-layer-opacity));
15
+ --md-sys-tonal-pressed-layer-state: rgb(var(--md-sys-dark-on-secondary-container) / var(--md-sys-dark-state-pressed-state-layer-opacity));
16
+ --md-sys-filled-hover-layer-state: rgb(var(--md-sys-dark-on-primary) / var(--md-sys-dark-state-hover-state-layer-opacity));
17
+ --md-sys-filled-pressed-layer-state: rgb(var(--md-sys-dark-on-primary) / var(--md-sys-dark-state-pressed-state-layer-opacity));
18
+ --md-sys-outlined-hover-layer-state: rgb(var(--md-sys-dark-primary) / var(--md-sys-dark-state-hover-state-layer-opacity));
19
+ --md-sys-outlined-pressed-layer-state: rgb(var(--md-sys-dark-primary) / var(--md-sys-dark-state-pressed-state-layer-opacity));
20
+ }
21
+ }
22
+
23
+ .common-button--container {
24
+ height: 40px;
25
+ border-radius: 40px;
26
+ position: relative;
27
+ }
28
+
29
+ .common-button--content {
30
+ height: 100%;
31
+ display: flex;
32
+ justify-content: center;
33
+ align-items: center;
34
+ margin: 0 24px;
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
37
+ white-space: nowrap;
38
+ gap: 8px;
39
+ font-size: 14px;
40
+ }
41
+
42
+ .common-button--icon {
43
+ height: 18px;
44
+ height: 18px;
45
+ }
46
+
1
47
  .icon-button--container {
2
48
  height: 40px;
3
49
  width: 40px;
4
50
  }
51
+
52
+ .layer-state {
53
+ width: 100%;
54
+ height: 100%;
55
+ border-radius: 40px;
56
+ position: relative;
57
+ overflow: hidden;
58
+ background-position: center;
59
+ transition: background 0.4s;
60
+ }
61
+
62
+ .common-button__elevated {
63
+ box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 0.2), 0 3px 1px 1px rgba(0, 0, 0, 0.15);
64
+ @media (prefers-color-scheme: light) {
65
+ background: rgb(var(--md-sys-light-surface-container-low));
66
+ color: rgb(var(--md-sys-light-primary));
67
+ }
68
+ @media (prefers-color-scheme: dark) {
69
+ background: rgb(var(--md-sys-dark-surface-container-low));
70
+ color: rgb(var(--md-sys-dark-primary));
71
+ }
72
+ }
73
+
74
+ .common-button__elevated:not(:disabled)
75
+ .layer-state__elevated:hover,
76
+ .common-button__outlined:not(:disabled)
77
+ .layer-state__outlined:hover,
78
+ .common-button__text:not(:disabled)
79
+ .layer-state__text:hover {
80
+ background: var(--md-sys-outlined-hover-layer-state) radial-gradient(circle, transparent 1%, var(--md-sys-outlined-hover-layer-state) 1%) center/15000%;
81
+ }
82
+
83
+ .common-button__elevated:not(:disabled)
84
+ .layer-state__elevated:active,
85
+ .common-button__outlined:not(:disabled)
86
+ .layer-state__outlined:active,
87
+ .common-button__text:not(:disabled)
88
+ .layer-state__text:active {
89
+ background-size: 100%;
90
+ transition: background 0s;
91
+ background-color: var(--md-sys-outlined-pressed-layer-state);
92
+ }
93
+
94
+ .common-button__elevated:disabled, .common-button__filled:disabled, .common-button__tonal:disabled {
95
+ box-shadow: none;
96
+ @media (prefers-color-scheme: light) {
97
+ background: rgb(var(--md-sys-light-on-surface)/ var(--md-sys-light-state-hover-state-layer-opacity));
98
+ color: rgb(var(--md-sys-light-on-surface)/ var(--md-sys-light-state-disabled-state-layer-opacity));
99
+ }
100
+ @media (prefers-color-scheme: dark) {
101
+ background: rgb(var(--md-sys-dark-on-surface)/ var(--md-sys-dark-state-hover-state-layer-opacity));
102
+ color: rgb(var(--md-sys-dark-on-surface)/ var(--md-sys-dark-state-disabled-state-layer-opacity));
103
+ }
104
+ }
105
+
106
+ .common-button__filled {
107
+ @media (prefers-color-scheme: light) {
108
+ background: rgb(var(--md-sys-light-primary));
109
+ color: rgb(var(--md-sys-light-on-primary));
110
+ }
111
+ @media (prefers-color-scheme: dark) {
112
+ background: rgb(var(--md-sys-dark-primary));
113
+ color: rgb(var(--md-sys-dark-on-primary));
114
+ }
115
+ }
116
+
117
+ .common-button__filled:not(:disabled)
118
+ .layer-state__filled:hover {
119
+ background: var(--md-sys-filled-hover-layer-state) radial-gradient(circle, transparent 1%, var(--md-sys-filled-hover-layer-state) 1%) center/15000%;
120
+ }
121
+
122
+ .common-button__filled:not(:disabled)
123
+ .layer-state__filled:active {
124
+ background-size: 100%;
125
+ transition: background 0s;
126
+ background-color: var(--md-sys-filled-pressed-layer-state);
127
+ }
128
+
129
+ .common-button__outlined {
130
+ @media (prefers-color-scheme: light) {
131
+ color: rgb(var(--md-sys-light-primary));
132
+ border: 1px solid rgb(var(--md-sys-light-outline));
133
+ }
134
+ @media (prefers-color-scheme: dark) {
135
+ color: rgb(var(--md-sys-dark-primary));
136
+ border: 1px solid rgb(var(--md-sys-dark-outline));
137
+ }
138
+ }
139
+
140
+ .common-button__outlined:disabled {
141
+ @media (prefers-color-scheme: light) {
142
+ color: rgb(var(--md-sys-light-on-surface)/ var(--md-sys-light-state-disabled-state-layer-opacity));
143
+ border: 1px solid rgb(var(--md-sys-light-on-surface)/ var(--md-sys-light-state-hover-state-layer-opacity));
144
+ }
145
+ @media (prefers-color-scheme: dark) {
146
+ color: rgb(var(--md-sys-dark-on-surface)/ var(--md-sys-dark-state-disabled-state-layer-opacity));
147
+ border: 1px solid rgb(var(--md-sys-dark-on-surface)/ var(--md-sys-dark-state-hover-state-layer-opacity));
148
+ }
149
+ }
150
+
151
+ .common-button__text {
152
+ @media (prefers-color-scheme: light) {
153
+ color: rgb(var(--md-sys-light-primary));
154
+ }
155
+ @media (prefers-color-scheme: dark) {
156
+ color: rgb(var(--md-sys-dark-primary));
157
+ }
158
+ }
159
+
160
+ .common-button__text:disabled {
161
+ @media (prefers-color-scheme: light) {
162
+ color: rgb(var(--md-sys-light-on-surface)/ var(--md-sys-light-state-disabled-state-layer-opacity));
163
+ }
164
+ @media (prefers-color-scheme: dark) {
165
+ color: rgb(var(--md-sys-dark-on-surface)/ var(--md-sys-dark-state-disabled-state-layer-opacity));
166
+ }
167
+ }
168
+
169
+ .common-button__tonal {
170
+ @media (prefers-color-scheme: light) {
171
+ background: rgb(var(--md-sys-light-secondary-container));
172
+ color: rgb(var(--md-sys-light-on-secondary-container));
173
+ }
174
+ @media (prefers-color-scheme: dark) {
175
+ background: rgb(var(--md-sys-dark-secondary-container));
176
+ color: rgb(var(--md-sys-dark-on-secondary-container));
177
+ }
178
+ }
179
+
180
+ .common-button__tonal:not(:disabled) .layer-state__tonal:hover {
181
+ background: var(--md-sys-tonal-hover-layer-state) radial-gradient(circle, transparent 1%, var(--md-sys-tonal-hover-layer-state) 1%) center/15000%;
182
+ }
183
+
184
+ .common-button__tonal:not(:disabled) .layer-state__tonal:active {
185
+ background-color: var(--md-sys-tonal-pressed-layer-state);
186
+ background-size: 100%;
187
+ transition: background 0s;
188
+ }
@@ -1,15 +1,12 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Material design</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag "material_design/application", media: "all" %>
9
- </head>
10
- <body>
11
-
12
- <%= yield %>
13
-
14
- </body>
3
+ <head>
4
+ <title>Material design</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+ <%= stylesheet_link_tag "material_design/application", media: "all" %>
8
+ </head>
9
+ <body>
10
+ <%= yield %>
11
+ </body>
15
12
  </html>
@@ -0,0 +1,10 @@
1
+ <button class="common-button--container common-button__elevated" <%= "disabled" if locals[:disabled] %> >
2
+ <div class="layer-state layer-state__elevated">
3
+ <div class="common-button--content">
4
+ <% if locals[:icon] %>
5
+ <%= render "material_design/icons/icon", locals: {icon: locals[:icon], size: 18} %>
6
+ <% end %>
7
+ <%= locals[:label] %>
8
+ </div>
9
+ </div>
10
+ </button>
@@ -0,0 +1,10 @@
1
+ <button class="common-button--container common-button__filled" <%= "disabled" if locals[:disabled] %> >
2
+ <div class="layer-state layer-state__filled">
3
+ <div class="common-button--content">
4
+ <% if locals[:icon] %>
5
+ <%= render "material_design/icons/icon", locals: {icon: locals[:icon], size: 18} %>
6
+ <% end %>
7
+ <%= locals[:label] %>
8
+ </div>
9
+ </div>
10
+ </button>
@@ -0,0 +1,10 @@
1
+ <button class="common-button--container common-button__outlined" <%= "disabled" if locals[:disabled] %> >
2
+ <div class="layer-state layer-state__outlined">
3
+ <div class="common-button--content">
4
+ <% if locals[:icon] %>
5
+ <%= render "material_design/icons/icon", locals: {icon: locals[:icon], size: 18} %>
6
+ <% end %>
7
+ <%= locals[:label] %>
8
+ </div>
9
+ </div>
10
+ </button>
@@ -0,0 +1,10 @@
1
+ <button class="common-button--container common-button__text" <%= "disabled" if locals[:disabled] %> >
2
+ <div class="layer-state layer-state__text">
3
+ <div class="common-button--content">
4
+ <% if locals[:icon] %>
5
+ <%= render "material_design/icons/icon", locals: {icon: locals[:icon], size: 18} %>
6
+ <% end %>
7
+ <%= locals[:label] %>
8
+ </div>
9
+ </div>
10
+ </button>
@@ -0,0 +1,10 @@
1
+ <button class="common-button--container common-button__tonal" <%= "disabled" if locals[:disabled] %> >
2
+ <div class="layer-state layer-state__tonal">
3
+ <div class="common-button--content">
4
+ <% if locals[:icon] %>
5
+ <%= render "material_design/icons/icon", locals: {icon: locals[:icon], size: 18} %>
6
+ <% end %>
7
+ <%= locals[:label] %>
8
+ </div>
9
+ </div>
10
+ </button>
@@ -1,3 +1,3 @@
1
1
  module MaterialDesign
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_design
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Yutaka Nakanishi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-06-20 00:00:00.000000000 Z
13
+ date: 2024-07-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -54,8 +54,13 @@ files:
54
54
  - app/models/material_design/application_record.rb
55
55
  - app/views/layouts/material_design/application.html.erb
56
56
  - app/views/material_design/app_bars/_top_bar.html.erb
57
+ - app/views/material_design/buttons/_elevated_button.html.erb
57
58
  - app/views/material_design/buttons/_fab.html.erb
59
+ - app/views/material_design/buttons/_filled_button.html.erb
58
60
  - app/views/material_design/buttons/_icon_button.html.erb
61
+ - app/views/material_design/buttons/_outlined_button.html.erb
62
+ - app/views/material_design/buttons/_text_button.html.erb
63
+ - app/views/material_design/buttons/_tonal_button.html.erb
59
64
  - app/views/material_design/cards/_outlined.html.erb
60
65
  - app/views/material_design/dividers/_horizontal.html.erb
61
66
  - app/views/material_design/icons/_10k.html.erb
@@ -2222,7 +2227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2222
2227
  - !ruby/object:Gem::Version
2223
2228
  version: '0'
2224
2229
  requirements: []
2225
- rubygems_version: 3.4.10
2230
+ rubygems_version: 3.5.3
2226
2231
  signing_key:
2227
2232
  specification_version: 4
2228
2233
  summary: Material Design