-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from heyjul3s/docs/generator-docs-update
Update Generator Doc
- Loading branch information
Showing
6 changed files
with
62 additions
and
18 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
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
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
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 |
---|---|---|
|
@@ -51,7 +51,6 @@ const headings = { | |
const text = { | ||
base: { | ||
styles: { | ||
marginTop: 0, | ||
lineHeight: 1.45 | ||
} | ||
}, | ||
|
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
18 changes: 8 additions & 10 deletions
18
docs/page-content/Generator/examples/createStyledComponentUsage.ts
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,18 +1,16 @@ | ||
export const createStyledComponentUsage = ` | ||
import { HTMLAttributes } from 'react'; | ||
import { position, PositionProps } from 'styled-system'; | ||
import { theme } from './theme'; | ||
// A basic example | ||
const StyledArticle = createStyledComponent<PositionProps>({ | ||
type CardProps = { | ||
isHidden: boolean; | ||
} & PositionProps; | ||
const StyledArticle = createStyledComponent<CardProps, typeof theme, HTMLAttributes<HTMLDivElement>>({ | ||
styles: { position: 'relative' }, | ||
attrs: { title: 'Hello World' }, | ||
styledProps: [position], | ||
element: 'article' | ||
}); | ||
// If you need to add attributes, you can do it like so | ||
// By default, element is set as "DIV" | ||
const StyledButton = createStyledComponent<PositionProps>({ | ||
attrs: ({ role }) => ({ role: role || 'button' }) | ||
styles: { position: 'relative' }, | ||
styledProps: [position], | ||
}) | ||
`; |