-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mantine.dev] Update size component based on media query example
- Loading branch information
Showing
3 changed files
with
6 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/@docs/demos/src/demos/styles/Styles.demo.sizesMedia.module.css
This file was deleted.
Oops, something went wrong.
51 changes: 5 additions & 46 deletions
51
packages/@docs/demos/src/demos/styles/Styles.demo.sizesMedia.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,30 @@ | ||
import { TextInput } from '@mantine/core'; | ||
import { MantineDemo } from '@mantinex/demo'; | ||
import classes from './Styles.demo.sizesMedia.module.css'; | ||
|
||
const code = ` | ||
import { TextInput } from '@mantine/core'; | ||
import classes from './Demo.module.css'; | ||
function Demo() { | ||
return ( | ||
<> | ||
<TextInput | ||
label="My input" | ||
placeholder="My input" | ||
size="xs" | ||
className={classes['input-mobile']} | ||
/> | ||
<TextInput | ||
label="My input" | ||
placeholder="My input" | ||
size="xl" | ||
className={classes['input-desktop']} | ||
/> | ||
<TextInput size="xs" hiddenFrom="sm" label="My input" placeholder="My input" /> | ||
<TextInput size="xl" visibleFrom="sm" label="My input" placeholder="My input" /> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
const cssCode = ` | ||
.input-mobile { | ||
@media (min-width: em(750px)) { | ||
display: none; | ||
} | ||
} | ||
.input-desktop { | ||
display: none; | ||
@media (min-width: em(750px)) { | ||
display: block; | ||
} | ||
} | ||
`; | ||
|
||
function Demo() { | ||
return ( | ||
<> | ||
<TextInput | ||
label="My input" | ||
placeholder="My input" | ||
size="xs" | ||
className={classes['input-mobile']} | ||
/> | ||
<TextInput | ||
label="My input" | ||
placeholder="My input" | ||
size="xl" | ||
className={classes['input-desktop']} | ||
/> | ||
<TextInput size="xs" hiddenFrom="sm" label="My input" placeholder="My input" /> | ||
<TextInput size="xl" visibleFrom="sm" label="My input" placeholder="My input" /> | ||
</> | ||
); | ||
} | ||
|
||
export const sizesMedia: MantineDemo = { | ||
type: 'code', | ||
component: Demo, | ||
code: [ | ||
{ fileName: 'Demo.tsx', code, language: 'tsx' }, | ||
{ fileName: 'Demo.module.css', code: cssCode, language: 'scss' }, | ||
], | ||
code: { fileName: 'Demo.tsx', code, language: 'tsx' }, | ||
}; |