easy_menu 0.4.15 → 0.4.17

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: f6a638bcdfe297bb6e2f41352565b316fad190ee0fc6b533b259e7a72789ed09
4
- data.tar.gz: cf459de8ccd8c0fa2091fbb0b2a5b2d2ea13b5542a33345724194d2b4fccb41e
3
+ metadata.gz: 8c74da57817315dcfcff6acaf5d4fff133d0bb836878027f2d509c2660e1e7f0
4
+ data.tar.gz: 95fbbfca37f5f27a38042d31a64d439b6e8e84308d3f35067d0d77cb1f409454
5
5
  SHA512:
6
- metadata.gz: 2a6d582f91d3e1af6a17b2cbf6859034b125274606ee8789c3c3b4333bdef06adace04cfa7b5a60ca552ab64a8b3d060a1510c1be085e68802911b0904627342
7
- data.tar.gz: 12f98d925d7c7b6ae7717d4c43c6928f487958c1be35d655dfc8fb1e7adfef058ef36955f50a191675956f5e8fd4346c487de0953b7e9c027b5a5591792d4595
6
+ metadata.gz: a32e544bc8e0cb80fc1b993d38d99ff78865dcc3a2346f446bba16ad4704f3a850462ea5430ae4f0b65ba9a93ea30d5596f2a744b20d3de6387ee89429e69b15
7
+ data.tar.gz: a9b0fbd467c361a7266e556304b375b830a6d7fbe38f3ee0bac37bf3ae18292fa2faa8470f5c64a97c05d5aa9bca215d7a5284c10da38ad7f0886404f26b92f0
@@ -20,7 +20,7 @@ $menu-border-width: 1px;
20
20
  $menu-vertical-padding: 0.2em;
21
21
  $menu-item-vertical-padding: 0.4em;
22
22
  $menu-item-horizontal-padding: 2em;
23
- $menu-item-disabled-text-color: #AAA;
23
+ $menu-item-disabled-text-colour: #AAA;
24
24
  // Make the button border appear even when in a group by popping the button up above its siblings
25
25
  $menu-bar-item-zindex: 1;
26
26
  $menu-bar-item-hover-zindex: 2;
@@ -79,6 +79,12 @@ $menu-bar-item-pressed-zindex: 3;
79
79
 
80
80
  background-color: mix($light, $dark);
81
81
 
82
+ @if is-light($text-colour) {
83
+ --icon-filter: brightness(6);
84
+ } @else {
85
+ --icon-filter: brightness(1);
86
+ }
87
+
82
88
  // Don't override the background if the browser doesn't support gradients otherwise the buttons will be too dark
83
89
  &:not(oldbrowser){
84
90
  @include gradient($light, $dark);
@@ -253,7 +259,7 @@ $menu-bar-item-pressed-zindex: 3;
253
259
  @mixin menu_item_disabled{
254
260
  &.disabled, &.disabled > *{
255
261
  cursor: default;
256
- color: $menu-item-disabled-text-color;
262
+ color: $menu-item-disabled-text-colour;
257
263
  }
258
264
  }
259
265
 
@@ -261,4 +267,11 @@ $menu-bar-item-pressed-zindex: 3;
261
267
  background-image: asset_url('icons.png');
262
268
  background-position: $indent -24px * ($iconNumber - 1);
263
269
  background-repeat: no-repeat;
270
+ filter: var(--icon-filter);
271
+ }
272
+
273
+ @function is-light($color) {
274
+ $result: invert($color);
275
+ $lightness: lightness($result);
276
+ @return $lightness < 50;
264
277
  }
@@ -137,10 +137,9 @@
137
137
 
138
138
  }
139
139
  &.with_menu {
140
- .menu_bar_item .arrow{
140
+ .menu_bar_item .arrow {
141
141
  @include easy_menu_icon(5, center);
142
- margin: -12px -9px -12px -4px;
143
- padding: 24px 14px 0 0;
142
+ padding: 24px 0 0 0;
144
143
  vertical-align: middle;
145
144
  width: 10px;
146
145
  display: inline-block;
@@ -149,7 +148,7 @@
149
148
  }
150
149
  &.with_menu.no_js:hover, &.with_menu.open{
151
150
  .menu_bar_item {
152
- background: white;
151
+ @include button_colour(white, white, $text-colour: $menu-bar-item-text-color, $text-shadow: none);
153
152
  border-radius: 2px 2px 0 0;
154
153
  @include menu-bar-item-border-colour-with-fallback;
155
154
  border-bottom: none;
data/lib/menu_bar.rb CHANGED
@@ -84,7 +84,7 @@ class MenuBar
84
84
  arrow = @template.content_tag(:span, '', :class => config[:menu_bar_item_arrow_class])
85
85
 
86
86
  m = Menu.new(config, options)
87
- mbt = MenuBarTrigger.new(config, button_text.html_safe + arrow, m, options[:menu_bar_item])
87
+ mbt = MenuBarTrigger.new(config, button_text.html_safe + ' ' + arrow, m, options[:menu_bar_item])
88
88
 
89
89
  yield m if block_given?
90
90
 
@@ -170,7 +170,7 @@ class MenuBar
170
170
  end
171
171
 
172
172
  def to_s
173
- empty? ? '' : wrap_content(@content.join.html_safe) # Don't render anything if empty
173
+ empty? ? ''.html_safe : wrap_content(@content.join.html_safe) # Don't render anything if empty
174
174
  end
175
175
 
176
176
  def right_aligned?
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.15
4
+ version: 0.4.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Jakobsen
8
8
  - Ryan Wallace
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-17 00:00:00.000000000 Z
12
+ date: 2024-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -25,8 +25,8 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '3.1'
28
- description:
29
- email:
28
+ description:
29
+ email:
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
@@ -44,10 +44,10 @@ files:
44
44
  - lib/easy_menu_configuration.rb
45
45
  - lib/easy_menu_helpers.rb
46
46
  - lib/menu_bar.rb
47
- homepage:
47
+ homepage:
48
48
  licenses: []
49
49
  metadata: {}
50
- post_install_message:
50
+ post_install_message:
51
51
  rdoc_options: []
52
52
  require_paths:
53
53
  - lib
@@ -62,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.3.23
66
- signing_key:
65
+ rubygems_version: 3.5.13
66
+ signing_key:
67
67
  specification_version: 4
68
68
  summary: Simple menu bar DSL for Rails views
69
69
  test_files: []