@troshab/slidev-theme-troshab 0.1.3 → 0.1.6

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.
@@ -45,6 +45,7 @@ defineProps<{
45
45
  padding: 1rem 1rem 1rem 1.25rem;
46
46
  margin-block: 1rem;
47
47
  background-color: var(--color-bg-soft);
48
+ color: var(--color-text);
48
49
  border-left: var(--border-accent) solid var(--color-info);
49
50
  border-radius: 0 0.375rem 0.375rem 0;
50
51
  }
@@ -19,7 +19,7 @@ defineProps<{
19
19
  <h1 class="definition-term">{{ term }}</h1>
20
20
  <div v-if="pronunciation || partOfSpeech" class="definition-meta">
21
21
  <span v-if="pronunciation" class="definition-pronunciation">{{ pronunciation }}</span>
22
- <span v-if="partOfSpeech" class="definition-pos">{{ partOfSpeech }}</span>
22
+ <span v-if="pronunciation && partOfSpeech" class="definition-pos">{{ partOfSpeech }}</span>
23
23
  </div>
24
24
  <div class="definition-body">
25
25
  <slot />
@@ -74,7 +74,7 @@ const clicksContext = inject<Ref<ClicksContext>>('$$slidev-clicks-context', ref(
74
74
 
75
75
  // --- Auto v-click registration (clicks mode) ---
76
76
  const rootEl = ref<HTMLElement | null>(null)
77
- const autoActiveStep = ref(props.start)
77
+ const autoActiveStep = ref(1)
78
78
  const isAutoRegistered = ref(false)
79
79
 
80
80
  onMounted(() => {
@@ -82,7 +82,7 @@ onMounted(() => {
82
82
  const ctx = clicksContext.value
83
83
  if (!ctx?.calculateSince || !rootEl.value) return
84
84
 
85
- const size = normalizedItems.value.length - props.start
85
+ const size = normalizedItems.value.length - 1
86
86
  if (size <= 0) return
87
87
 
88
88
  const info = ctx.calculateSince('+1', size)
@@ -97,7 +97,7 @@ onMounted(() => {
97
97
  watchEffect(() => {
98
98
  const active = isActiveRef.value
99
99
  const offset = offsetRef.value
100
- autoActiveStep.value = active ? Math.min(offset + props.start + 1, normalizedItems.value.length) : props.start
100
+ autoActiveStep.value = active ? Math.min(offset + 2, normalizedItems.value.length) : 1
101
101
  })
102
102
  })
103
103
 
@@ -113,7 +113,7 @@ const activeStep = computed(() => {
113
113
  if (isAutoRegistered.value) return autoActiveStep.value
114
114
  // Fallback: direct click count (non-Slidev contexts)
115
115
  const clicks = clicksContext.value?.current ?? 0
116
- return Math.min(clicks + props.start, normalizedItems.value.length)
116
+ return Math.min(clicks + 1, normalizedItems.value.length)
117
117
  }
118
118
  return props.current
119
119
  })
@@ -194,7 +194,7 @@ function isUpcoming(index: number) {
194
194
  </template>
195
195
  <!-- Number (numbers + arrows) -->
196
196
  <template v-else-if="variant !== 'dots'">
197
- {{ index + 1 }}
197
+ {{ index + start }}
198
198
  </template>
199
199
  <!-- Dots: empty circle, no content -->
200
200
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@troshab/slidev-theme-troshab",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "description": "A minimal, universal Slidev theme with flexible layouts and ready-to-use slide templates",
5
5
  "author": "troshab",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -32,6 +32,8 @@
32
32
  "slidev": ">=0.50.0"
33
33
  },
34
34
  "dependencies": {
35
+ "@fontsource/ibm-plex-mono": "^5.2.7",
36
+ "@fontsource/ibm-plex-sans": "^5.2.8",
35
37
  "qrcode": "^1.5.4",
36
38
  "slidev-addon-asciinema": "^0.1.11",
37
39
  "slidev-addon-fancy-arrow": "^0.16.0",
@@ -49,8 +51,6 @@
49
51
  "audit:all": "node scripts/contrast-audit.mjs && node scripts/shiki-audit.mjs && node scripts/typography-audit.mjs && node scripts/chart-audit.mjs && node scripts/integrity-audit.mjs"
50
52
  },
51
53
  "devDependencies": {
52
- "@fontsource/ibm-plex-mono": "^5.2.7",
53
- "@fontsource/ibm-plex-sans": "^5.2.8",
54
54
  "@iconify-json/ph": "^1.2.2",
55
55
  "@slidev/cli": "^0.50.0",
56
56
  "@types/qrcode": "^1.5.5",
package/styles/base.css CHANGED
@@ -12,56 +12,17 @@
12
12
  @import './colors.css';
13
13
 
14
14
  /* ============================================
15
- 1. @font-face — IBM Plex (local)
15
+ 1. @font-face — IBM Plex via @fontsource
16
+ Provides proper unicode-range subsetting
17
+ (latin, cyrillic, cyrillic-ext, etc.)
16
18
  ============================================ */
17
19
 
18
- @font-face {
19
- font-family: 'IBM Plex Sans';
20
- src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2');
21
- font-weight: 400;
22
- font-style: normal;
23
- font-display: swap;
24
- }
25
-
26
- @font-face {
27
- font-family: 'IBM Plex Sans';
28
- src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2');
29
- font-weight: 500;
30
- font-style: normal;
31
- font-display: swap;
32
- }
33
-
34
- @font-face {
35
- font-family: 'IBM Plex Sans';
36
- src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
37
- font-weight: 600;
38
- font-style: normal;
39
- font-display: swap;
40
- }
41
-
42
- @font-face {
43
- font-family: 'IBM Plex Sans';
44
- src: url('../fonts/IBMPlexSans-Bold.woff2') format('woff2');
45
- font-weight: 700;
46
- font-style: normal;
47
- font-display: swap;
48
- }
49
-
50
- @font-face {
51
- font-family: 'IBM Plex Mono';
52
- src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2');
53
- font-weight: 400;
54
- font-style: normal;
55
- font-display: swap;
56
- }
57
-
58
- @font-face {
59
- font-family: 'IBM Plex Mono';
60
- src: url('../fonts/IBMPlexMono-Medium.woff2') format('woff2');
61
- font-weight: 500;
62
- font-style: normal;
63
- font-display: swap;
64
- }
20
+ @import '@fontsource/ibm-plex-sans/400.css';
21
+ @import '@fontsource/ibm-plex-sans/500.css';
22
+ @import '@fontsource/ibm-plex-sans/600.css';
23
+ @import '@fontsource/ibm-plex-sans/700.css';
24
+ @import '@fontsource/ibm-plex-mono/400.css';
25
+ @import '@fontsource/ibm-plex-mono/500.css';
65
26
 
66
27
  /* ============================================
67
28
  2. CSS Custom Properties (Typography & Layout)