Skip to content

Commit a764fa2

Browse files
committed
Add staticMediaQuery config
1 parent 95731ad commit a764fa2

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

packages/mdx/src/mdx-client/scrollycoding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function Scrollycoding(props) {
2424
<Swap
2525
match={[
2626
[
27-
"screen and (min-width: 768px)",
27+
props.codeConfig.staticMediaQuery,
2828
<DynamicScrollycoding {...props} />,
2929
],
3030
["default", <StaticScrollycoding {...props} />],

packages/mdx/src/remark/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type CodeHikeConfig = {
55
skipLanguages: string[]
66
showExpandButton?: boolean
77
showCopyButton?: boolean
8+
staticMediaQuery?: string
89
// path to the current file, internal use only
910
filepath?: string
1011
}
@@ -19,6 +20,7 @@ export function addConfigDefaults(
1920
): CodeHikeConfig {
2021
// TODO warn when config looks weird
2122
return {
23+
staticMediaQuery: "screen and (min-width: 768px)",
2224
...config,
2325
theme: config?.theme || {},
2426
autoImport: config?.autoImport === false ? false : true,

packages/mdx/src/smooth-code/code-tween.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export type CodeConfig = {
4646
lineNumbers?: boolean
4747
showCopyButton?: boolean
4848
showExpandButton?: boolean
49+
staticMediaQuery?: string
4950
debug?: boolean
5051
}
5152

0 commit comments

Comments
 (0)