css-zero 1.1.11 → 1.1.12

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: bd553579a473a3540a8adef826e33aff68cce9c9285074dcad3c235263925b8c
4
- data.tar.gz: 73cda33c1b3cf346c3b97b4cf14e7f3ba42b83347710de95b8803b3f6ed2196d
3
+ metadata.gz: d241d4cf05ae86f025781e668e84bc615831440027ebb7d3cd649428054dfd05
4
+ data.tar.gz: 99809da55b172d4a350f9e834666b9523f105104f78ab7c41ec6309f24d4ad83
5
5
  SHA512:
6
- metadata.gz: 2bd0d3d1826713c47216b87ee3e12ee0624f8358947f5158b50153fbe2d4066de39cea608cbe48a1af138410af4c352b5dab678f9647f914844999252737f8e9
7
- data.tar.gz: c808198b01c9760f1c632941d78dec732b928a151f98bc7b4a9f8433384ca5c397ffa99fe8e9bf7b2194bc1f0a860a4260462b84044c8affaaf911d034aa8c6d
6
+ metadata.gz: 8598586278d3868d943d972fa8162958d82e836f14b2eac34b65b1971c07ce786bade524e64ebe98c0ad4d4dcb933cc672ef29c4d7d31cf2bf741273f346b5a8
7
+ data.tar.gz: 60acd5697d488f8c5a4f75c591086c8d9b487634e26342f91b924abac97937305bab305ada2ca0dc41070ceb9f5b1d579c098fc8420b8b0bb29c162cf70ecaaf
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
@@ -11,10 +11,6 @@
11
11
  overflow-x: hidden;
12
12
  scroll-behavior: smooth;
13
13
  scroll-snap-type: x mandatory;
14
-
15
- @supports (-moz-appearance: none) {
16
- scroll-behavior: auto;
17
- }
18
14
  }
19
15
 
20
16
  .carousel__item {
@@ -12,12 +12,12 @@
12
12
  border-start-start-radius: 0;
13
13
  }
14
14
 
15
- :is(:first-child + :last-child) {
16
- margin-inline-start: -1px;
15
+ :not(:first-child) {
16
+ border-inline-start: 0;
17
17
  }
18
18
 
19
19
  :not(:first-child, :last-child) {
20
- border-radius: 0; margin-inline: -1px;
20
+ border-radius: 0;
21
21
  }
22
22
 
23
23
  > :focus-visible {
@@ -4,10 +4,18 @@ export default class extends Controller {
4
4
  static targets = [ "content" ]
5
5
 
6
6
  next() {
7
- this.contentTarget.scrollBy(100, 0)
7
+ this.contentTarget.scrollTo({ left: this.#scrollLeft + this.#itemWidth })
8
8
  }
9
9
 
10
10
  prev() {
11
- this.contentTarget.scrollBy(-100, 0)
11
+ this.contentTarget.scrollTo({ left: this.#scrollLeft - this.#itemWidth })
12
+ }
13
+
14
+ get #scrollLeft() {
15
+ return this.contentTarget.scrollLeft
16
+ }
17
+
18
+ get #itemWidth() {
19
+ return this.contentTarget.firstElementChild?.offsetWidth || 0
12
20
  }
13
21
  }
@@ -6,6 +6,7 @@ export default class extends Controller {
6
6
  static values = { placement: { type: String, default: "bottom" } }
7
7
 
8
8
  #showTimer = null
9
+ #hideTimer = null
9
10
 
10
11
  initialize() {
11
12
  this.orient = this.orient.bind(this)
@@ -32,11 +33,13 @@ export default class extends Controller {
32
33
  }
33
34
 
34
35
  showLater() {
36
+ clearTimeout(this.#hideTimer)
35
37
  this.#showTimer = setTimeout(() => this.show(), 700)
36
38
  }
37
39
 
38
- hideClear() {
39
- clearTimeout(this.#showTimer); this.hide();
40
+ hideLater() {
41
+ clearTimeout(this.#showTimer)
42
+ this.#hideTimer = setTimeout(() => this.hide(), 300)
40
43
  }
41
44
 
42
45
  orient() {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-11 00:00:00.000000000 Z
11
+ date: 2025-03-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com