@scalar/code-highlight 0.0.26 → 0.0.27

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/code-highlight
2
2
 
3
+ ## 0.0.27
4
+
5
+ ### Patch Changes
6
+
7
+ - 799845f: feat(components): allow ScalarCodeblock to support different font sizes
8
+
3
9
  ## 0.0.26
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../src/code/highlight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAW9C;;GAEG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACrC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CACpC,UA4CF"}
1
+ {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../src/code/highlight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAW9C;;GAEG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACrC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CACpC,UA+CF"}
@@ -39,7 +39,9 @@ function syntaxHighlight(codeString, options) {
39
39
  const htmlString = html.toString();
40
40
  // Replace any credentials with a wrapper element
41
41
  return credentials.length
42
- ? credentials.reduce((acc, credential) => acc.split(credential).join(`<span class="credentials">${credential}</span>`), htmlString)
42
+ ? credentials.reduce((acc, credential) => acc
43
+ .split(credential)
44
+ .join(`<span class="credential"><span class="credential-value">${credential}</span></span>`), htmlString)
43
45
  : htmlString;
44
46
  }
45
47
  /**
package/dist/css/code.css CHANGED
@@ -1,6 +1,6 @@
1
1
  .scalar-app {
2
- code.hljs * {
3
- font-size: var(--scalar-small);
2
+ :where(code.hljs) * {
3
+ font-size: inherit;
4
4
  font-family: var(--scalar-font-code);
5
5
  text-align: left;
6
6
  white-space: pre;
@@ -12,7 +12,7 @@
12
12
  }
13
13
  code.hljs {
14
14
  all: unset;
15
- font-size: var(--scalar-small);
15
+ font-size: inherit;
16
16
  color: var(--scalar-color-2);
17
17
  font-family: var(--scalar-font-code);
18
18
  display: inline-block;
@@ -139,15 +139,14 @@
139
139
  }
140
140
 
141
141
  /** Hide credentials */
142
- .credentials {
143
- font-size: 0 !important;
142
+ .credential .credential-value {
143
+ font-size: 0;
144
144
  color: transparent;
145
145
  }
146
146
 
147
147
  /** Show a few dots instead */
148
- .credentials::after {
148
+ .credential::after {
149
149
  content: "·····";
150
- font-size: var(--scalar-small);
151
150
  color: var(--scalar-color-3);
152
151
  user-select: none;
153
152
  }
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "lowlight",
17
17
  "highlightjs"
18
18
  ],
19
- "version": "0.0.26",
19
+ "version": "0.0.27",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },