This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docz): add css preprocessor examples and info
- Loading branch information
1 parent
a53a1fe
commit 38a4709
Showing
29 changed files
with
427 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.docz | ||
node_modules |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# less Docz example | ||
|
||
## Using `create-docz-app` | ||
|
||
```sh | ||
npx create-docz-app docz-app-less --example less | ||
# or | ||
yarn create docz-app docz-app-less --example less | ||
``` | ||
|
||
## Download manually | ||
|
||
```sh | ||
curl https://codeload.github.com/doczjs/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/less | ||
mv less docz-less-example | ||
cd docz-less-example | ||
``` | ||
|
||
## Setup | ||
|
||
```sh | ||
yarn # npm i | ||
``` | ||
|
||
## Run | ||
|
||
```sh | ||
yarn dev # npm run dev | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
title: 'Docz Less', | ||
menu: ['Getting Started', 'Components'], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
plugins: ['gatsby-plugin-less'], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"private": true, | ||
"name": "docz-example-less", | ||
"version": "2.0.0-rc.52", | ||
"license": "MIT", | ||
"files": [ | ||
"src/", | ||
"doczrc.js", | ||
"package.json" | ||
], | ||
"scripts": { | ||
"dev": "docz dev", | ||
"build": "docz build" | ||
}, | ||
"dependencies": { | ||
"docz": "next", | ||
"gatsby-plugin-less": "3.0.9", | ||
"less": "3.10.3", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"scheduler": "^0.15.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import t from 'prop-types' | ||
|
||
import './Alert.less' | ||
|
||
export const Alert = ({ children, kind, ...rest }) => ( | ||
<div className="Alert" {...rest}> | ||
{children} | ||
</div> | ||
) | ||
|
||
Alert.propTypes = { | ||
kind: t.oneOf(['info', 'positive', 'negative', 'warning']), | ||
} | ||
|
||
Alert.defaultProps = { | ||
kind: 'info', | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.Alert { | ||
padding: 1rem; | ||
margin: 1rem; | ||
border-radius: 0.25rem; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Alert | ||
menu: Components | ||
--- | ||
|
||
import { Playground, Props } from 'docz' | ||
import { Alert } from './Alert' | ||
|
||
# Alert | ||
|
||
## Properties | ||
|
||
<Props of={Alert} /> | ||
|
||
## Basic usage | ||
|
||
<Playground> | ||
<Alert>Some message</Alert> | ||
</Playground> | ||
|
||
## Using different kinds | ||
|
||
<Playground> | ||
<Alert kind="info">Some message</Alert> | ||
<Alert kind="positive">Some message</Alert> | ||
<Alert kind="negative">Some message</Alert> | ||
<Alert kind="warning">Some message</Alert> | ||
</Playground> |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Getting Started | ||
route: / | ||
--- | ||
|
||
# Getting Started | ||
|
||
Design systems enable teams to build better products faster by making design reusable—reusability makes scale possible. This is the heart and primary value of design systems. A design system is a collection of reusable components, guided by clear standards, that can be assembled together to build any number of applications. | ||
|
||
Regardless of the technologies and tools behind them, a successful design system follows these guiding principles: | ||
|
||
- **It’s consistent**. The way components are built and managed follows a predictable pattern. | ||
- **It’s self-contained**. Your design system is treated as a standalone dependency. | ||
- **It’s reusable**. You’ve built components so they can be reused in many contexts. | ||
- **It’s accessible**. Applications built with your design system are usable by as many people as possible, no matter how they access the web. | ||
- **It’s robust**. No matter the product or platform to which your design system is applied, it should perform with grace and minimal bugs. | ||
|
||
## Consistency | ||
|
||
Your first, most important task when starting out is to define the rules of your system, document them, and ensure that everyone follows them. When you have clearly documented code standards and best practices in place, designers and developers from across your organization can easily use and, more importantly, contribute to your design system. |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.docz | ||
node_modules |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Sass Docz example | ||
|
||
## Using `create-docz-app` | ||
|
||
```sh | ||
npx create-docz-app docz-app-sass --example sass | ||
# or | ||
yarn create docz-app docz-app-sass --example sass | ||
``` | ||
|
||
## Download manually | ||
|
||
```sh | ||
curl https://codeload.github.com/doczjs/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/sass | ||
mv sass docz-sass-example | ||
cd docz-sass-example | ||
``` | ||
|
||
## Setup | ||
|
||
```sh | ||
yarn # npm i | ||
``` | ||
|
||
## Run | ||
|
||
```sh | ||
yarn dev # npm run dev | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
title: 'Docz Sass', | ||
menu: ['Getting Started', 'Components'], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
plugins: ['gatsby-plugin-sass'], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"private": true, | ||
"name": "docz-example-sass", | ||
"version": "2.0.0-rc.52", | ||
"license": "MIT", | ||
"files": [ | ||
"src/", | ||
"doczrc.js", | ||
"package.json" | ||
], | ||
"scripts": { | ||
"dev": "docz dev", | ||
"build": "docz build" | ||
}, | ||
"dependencies": { | ||
"docz": "next", | ||
"gatsby-plugin-sass": "2.1.17", | ||
"node-sass": "4.12.0", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"scheduler": "^0.15.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import t from 'prop-types' | ||
|
||
import './Alert.scss' | ||
|
||
export const Alert = ({ children, kind, ...rest }) => ( | ||
<div className="Alert" {...rest}> | ||
{children} | ||
</div> | ||
) | ||
|
||
Alert.propTypes = { | ||
kind: t.oneOf(['info', 'positive', 'negative', 'warning']), | ||
} | ||
|
||
Alert.defaultProps = { | ||
kind: 'info', | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Alert | ||
menu: Components | ||
--- | ||
|
||
import { Playground, Props } from 'docz' | ||
import { Alert } from './Alert' | ||
|
||
# Alert | ||
|
||
## Properties | ||
|
||
<Props of={Alert} /> | ||
|
||
## Basic usage | ||
|
||
<Playground> | ||
<Alert>Some message</Alert> | ||
</Playground> | ||
|
||
## Using different kinds | ||
|
||
<Playground> | ||
<Alert kind="info">Some message</Alert> | ||
<Alert kind="positive">Some message</Alert> | ||
<Alert kind="negative">Some message</Alert> | ||
<Alert kind="warning">Some message</Alert> | ||
</Playground> |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.Alert { | ||
padding: 1rem; | ||
margin: 1rem; | ||
border-radius: 0.25rem; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Getting Started | ||
route: / | ||
--- | ||
|
||
# Getting Started | ||
|
||
Design systems enable teams to build better products faster by making design reusable—reusability makes scale possible. This is the heart and primary value of design systems. A design system is a collection of reusable components, guided by clear standards, that can be assembled together to build any number of applications. | ||
|
||
Regardless of the technologies and tools behind them, a successful design system follows these guiding principles: | ||
|
||
- **It’s consistent**. The way components are built and managed follows a predictable pattern. | ||
- **It’s self-contained**. Your design system is treated as a standalone dependency. | ||
- **It’s reusable**. You’ve built components so they can be reused in many contexts. | ||
- **It’s accessible**. Applications built with your design system are usable by as many people as possible, no matter how they access the web. | ||
- **It’s robust**. No matter the product or platform to which your design system is applied, it should perform with grace and minimal bugs. | ||
|
||
## Consistency | ||
|
||
Your first, most important task when starting out is to define the rules of your system, document them, and ensure that everyone follows them. When you have clearly documented code standards and best practices in place, designers and developers from across your organization can easily use and, more importantly, contribute to your design system. |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.docz | ||
node_modules |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# stylus Docz example | ||
|
||
## Using `create-docz-app` | ||
|
||
```sh | ||
npx create-docz-app docz-app-stylus --example stylus | ||
# or | ||
yarn create docz-app docz-app-stylus --example stylus | ||
``` | ||
|
||
## Download manually | ||
|
||
```sh | ||
curl https://codeload.github.com/doczjs/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/stylus | ||
mv stylus docz-stylus-example | ||
cd docz-stylus-example | ||
``` | ||
|
||
## Setup | ||
|
||
```sh | ||
yarn # npm i | ||
``` | ||
|
||
## Run | ||
|
||
```sh | ||
yarn dev # npm run dev | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
title: 'Docz Stylus', | ||
menu: ['Getting Started', 'Components'], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
plugins: ['gatsby-plugin-stylus'], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"private": true, | ||
"name": "docz-example-stylus", | ||
"version": "2.0.0-rc.52", | ||
"license": "MIT", | ||
"files": [ | ||
"src/", | ||
"doczrc.js", | ||
"package.json" | ||
], | ||
"scripts": { | ||
"dev": "docz dev", | ||
"build": "docz build" | ||
}, | ||
"dependencies": { | ||
"docz": "next", | ||
"gatsby-plugin-stylus": "2.1.11", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"scheduler": "^0.15.0" | ||
} | ||
} |
Oops, something went wrong.