showcase-rails 0.4.5 → 0.4.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: 88e437d814d89cdc6a3d023edce093a5ebe92da961b5658013cd57bae84af123
4
- data.tar.gz: 7eef04b815c656c4c2eba45164ed0c1e7c6d2352053e5dc3c11854959b88e726
3
+ metadata.gz: 5d55137272e05cac25eb1a63619d93aec93e58920ce0e10bebe89e4e93212bd2
4
+ data.tar.gz: 98de3fa5a6a81932393911af0eef39d586e01fcc97dd92e78be74be308dbb660
5
5
  SHA512:
6
- metadata.gz: 96caaccee98301814f06c6e3022a7e01b222a865deedb5c5198da5b39540596174f5f03a4b4f6b7746a973d81050cd2a747fba3b7241b19a82d3c57d7d8c9e7e
7
- data.tar.gz: c59ef24d8e7a378ab4151f092be16aafd7a8e8027a745256f5d96e050ed7c703b2101c0fa361773673f5c07e4f5f7f4a42288cf6dd6bda0e34f38d7e66077a20
6
+ metadata.gz: 81a0a673de41fb14f2790ceafc3657729cd12c2af9049c535bb60fbb03a1b724f8086f141d231758b9e4eb839a53af290a8f13f57e524bf409e7d94bab775dd3
7
+ data.tar.gz: 5fb343533e486ccb31985b40fef3ce5482ca6594a2bc2838ec4afa60eb38d412e1a40b58c0de254f22a410f32b80e9c7bfa7f80a907c670ba35387d64e4c1c02
@@ -191,6 +191,10 @@ pre {
191
191
  display: list-item;
192
192
  }
193
193
 
194
+ .sc-hidden {
195
+ display: none;
196
+ }
197
+
194
198
  .sc-h-full {
195
199
  height: 100%;
196
200
  }
@@ -241,6 +245,10 @@ pre {
241
245
  align-items: center;
242
246
  }
243
247
 
248
+ .sc-items-baseline {
249
+ align-items: baseline;
250
+ }
251
+
244
252
  .sc-justify-between {
245
253
  justify-content: space-between;
246
254
  }
@@ -479,33 +487,39 @@ pre {
479
487
  background-color: rgb(238 242 255 / var(--tw-bg-opacity));
480
488
  }
481
489
 
482
- @media (prefers-color-scheme: dark) {
483
- .dark\:sc-bg-neutral-700\/50 {
484
- background-color: rgb(64 64 64 / 0.5);
485
- }
490
+ :is(.sc-dark .dark\:sc-block) {
491
+ display: block;
492
+ }
486
493
 
487
- .dark\:sc-bg-neutral-800 {
488
- --tw-bg-opacity: 1;
489
- background-color: rgb(38 38 38 / var(--tw-bg-opacity));
490
- }
494
+ :is(.sc-dark .dark\:sc-hidden) {
495
+ display: none;
496
+ }
491
497
 
492
- .dark\:sc-bg-neutral-900 {
493
- --tw-bg-opacity: 1;
494
- background-color: rgb(23 23 23 / var(--tw-bg-opacity));
495
- }
498
+ :is(.sc-dark .dark\:sc-bg-neutral-700\/50) {
499
+ background-color: rgb(64 64 64 / 0.5);
500
+ }
496
501
 
497
- .dark\:sc-text-inherit {
498
- color: inherit;
499
- }
502
+ :is(.sc-dark .dark\:sc-bg-neutral-800) {
503
+ --tw-bg-opacity: 1;
504
+ background-color: rgb(38 38 38 / var(--tw-bg-opacity));
505
+ }
500
506
 
501
- .dark\:sc-text-white {
502
- --tw-text-opacity: 1;
503
- color: rgb(255 255 255 / var(--tw-text-opacity));
504
- }
507
+ :is(.sc-dark .dark\:sc-bg-neutral-900) {
508
+ --tw-bg-opacity: 1;
509
+ background-color: rgb(23 23 23 / var(--tw-bg-opacity));
510
+ }
505
511
 
506
- .dark\:hover\:sc-bg-neutral-700\/50:hover {
507
- background-color: rgb(64 64 64 / 0.5);
508
- }
512
+ :is(.sc-dark .dark\:sc-text-inherit) {
513
+ color: inherit;
514
+ }
515
+
516
+ :is(.sc-dark .dark\:sc-text-white) {
517
+ --tw-text-opacity: 1;
518
+ color: rgb(255 255 255 / var(--tw-text-opacity));
519
+ }
520
+
521
+ :is(.sc-dark .dark\:hover\:sc-bg-neutral-700\/50:hover) {
522
+ background-color: rgb(64 64 64 / 0.5);
509
523
  }
510
524
 
511
525
  @media (min-width: 768px) {
@@ -4,6 +4,23 @@
4
4
  <title>Showcase</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
 
7
+ <script>
8
+ // We're setting this directly here to help prevent Flash of Unstyled Content (FOUC).
9
+ class Showcase {
10
+ static start() {
11
+ const preference = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"
12
+ this.colorScheme = localStorage.colorScheme || preference
13
+ }
14
+
15
+ static set colorScheme(value) {
16
+ localStorage.colorScheme = value
17
+ document.documentElement.classList.toggle("sc-dark", value === "dark")
18
+ }
19
+ }
20
+
21
+ Showcase.start()
22
+ </script>
23
+
7
24
  <%= render "showcase/engine/head" %>
8
25
  <%= render "showcase/engine/stylesheets" %>
9
26
  <%= render "showcase/engine/javascripts" %>
@@ -1,9 +1,16 @@
1
1
  <main class="sc-flex sc-flex-wrap dark:sc-bg-neutral-900 dark:sc-text-white" aria-labelledby="showcase_main_title">
2
2
  <section class="sc-grid sc-grid-cols-12 sc-w-full">
3
3
  <nav class="sc-col-span-3 xl:sc-col-span-2 sc-h-full sc-border-0 sc-border-r sc-border-solid sc-border-gray-200">
4
- <h1 id="showcase_main_title" class="sc-font-black sc-text-2xl sc-m-0">
5
- <%= link_to "Showcase", root_url, class: "sc-link sc-block sc-pt-5 sc-pb-2 sc-pl-4" %>
6
- </h1>
4
+ <header class="sc-flex sc-items-baseline sc-pt-5 sc-pb-2 sc-pl-4">
5
+ <h1 id="showcase_main_title" class="sc-font-black sc-text-2xl sc-m-0">
6
+ <%= link_to "Showcase", root_url, class: "sc-link" %>
7
+ </h1>
8
+
9
+ <section class="sc-link sc-text-sm sc-px-2 sc-cursor-pointer">
10
+ <a onclick="Showcase.colorScheme = 'light'" class="sc-hidden dark:sc-block">light mode</a>
11
+ <a onclick="Showcase.colorScheme = 'dark'" class="sc-block dark:sc-hidden">dark mode</a>
12
+ </section>
13
+ </header>
7
14
 
8
15
  <%= render Showcase::Path.tree %>
9
16
  </nav>
@@ -1,6 +1,7 @@
1
1
  const defaultTheme = require('tailwindcss/defaultTheme')
2
2
 
3
3
  module.exports = {
4
+ darkMode: 'class',
4
5
  prefix: 'sc-',
5
6
  content: [
6
7
  './public/*.html',
@@ -1,3 +1,3 @@
1
1
  module Showcase
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showcase-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pence
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-06-28 00:00:00.000000000 Z
12
+ date: 2023-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.4.10
106
+ rubygems_version: 3.4.17
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Showcase helps you show off and document your partials, components, view