Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis committed Jun 25, 2019
0 parents commit 22ed1ae
Show file tree
Hide file tree
Showing 20 changed files with 11,378 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Gatsby
public/
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"bracketSpacing": false,
"semi": false,
"singleQuote": true
}
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Gatsby Theme Primer

⚠️ DO NOT USE. This is an experiment.

## Setup

```sh
# Clone the repo
git clone https://github.com/primer/gatsby-theme-primer.git
cd gatsby-theme-primer

# Install dependencies
yarn

# Run example dev server
yarn workspace example develop
```
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "gatsby-theme-primer",
"private": true,
"version": "1.0.0",
"workspaces": [
"packages/*"
]
}
3 changes: 3 additions & 0 deletions packages/example/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
__experimentalThemes: [`gatsby-theme-primer`],
}
16 changes: 16 additions & 0 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "example",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"develop": "gatsby develop",
"build": "gatsby build"
},
"dependencies": {
"gatsby": "^2.10.4",
"gatsby-theme-primer": "*",
"react": "^16.8.6",
"react-dom": "^16.8.6"
}
}
10 changes: 10 additions & 0 deletions packages/example/src/data/nav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- title: Components
href: /components
items:
- title: Alerts
href: /components/alerts
- title: Utilities
href: /utilities
items:
- title: Padding
href: /utilities/padding
99 changes: 99 additions & 0 deletions packages/example/src/pages/components/alerts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Alerts

Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don't show more than one at a time.

## Default

Flash messages start off looking decently neutral—they're just light blue rounded rectangles.

```html
<div class="flash">
Flash message goes here.
</div>
```

You can put multiple paragraphs of text in a flash message—the last paragraph's bottom `margin` will be automatically override.

```html
<div class="flash">
<p>This is a longer flash message in it's own paragraph. It ends up looking something like this. If we keep adding more text, it'll eventually wrap to a new line.</p>
<p>And this is another paragraph.</p>
</div>
```

Should the need arise, you can quickly space out your flash message from surrounding content with a `.flash-messages` wrapper. *Note the extra top and bottom margin in the example below.*

```html
<div class="flash-messages">
<div class="flash">
Flash message goes here.
</div>
</div>
```

## Variations

Add `.flash-warn`, `.flash-error`, or `.flash-success` to the flash message to make it yellow, red, or green, respectively.

```html
<div class="flash flash-warn">
Flash message goes here.
</div>
```

```html
<div class="flash flash-error">
Flash message goes here.
</div>
```

```html
<div class="flash flash-success">
Flash message goes here.
</div>
```

## With icon

Add an icon to the left of the flash message to give it some funky fresh attention.

```erb
<div class="flash">
<%= octicon "alert" %>
Flash message with an icon goes here.
</div>
```

## With dismiss

Add a JavaScript enabled (via Crema) dismiss (close) icon on the right of any flash message.

```erb
<div class="flash">
<button class="flash-close js-flash-close" type="button"><%= octicon "x", :"aria-label" => "Close" %></button>
Dismissable flash message goes here.
</div>
```

## With action button

A flash message with an action button.

```html
<div class="flash">
<button type="submit" class="btn btn-sm primary flash-action">Complete action</button>
Flash message with action here.
</div>
```

## Full width flash

A flash message that is full width and removes border and border radius.

```html
<div class="flash flash-full">
<div class="container">
Full width flash message.
</div>
</div>
```
6 changes: 6 additions & 0 deletions packages/example/src/pages/components/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Components

Components make it easier to mark up a set of elements that are commonly grouped together with similar visual styles. Their base styles are shared and variants are added with modifier classes, so usually components are comprised of multiple classes. Most importantly, components should be highly reusable across the site, rather than built for specific pages or features. To achieve this:

* **Separate structure and skin:** This means to define repeating visual features (like background and border styles) as separate “skins” that you can mix-and-match with your various components to achieve a large amount of visual variety without much code.
* **Separate container and content:** Essentially, this means “rarely use location-dependent styles”. A component should look the same no matter where you put it.
89 changes: 89 additions & 0 deletions packages/example/src/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines (unless hovered over).

There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs.

There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs.

> There should be no margin above this first sentence.
>
> Blockquotes should be a lighter gray with a gray border along the left side.
>
> There should be no margin below this final sentence.
# Header 1

This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.

## Header 2

> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.
### Header 3

```
This is a code block following a header.
```

#### Header 4

* This is an unordered list following a header.
* This is an unordered list following a header.
* This is an unordered list following a header.

##### Header 5

1. This is an ordered list following a header.
2. This is an ordered list following a header.
3. This is an ordered list following a header.

###### Header 6

| What | Follows |
|-----------|-----------------|
| A table | A header |
| A table | A header |
| A table | A header |

----------------

There's a horizontal rule above and below this.

----------------

Here is an unordered list:

* Salt-n-Pepa
* Bel Biv DeVoe
* Kid 'N Play

And an ordered list:

1. Michael Jackson
2. Michael Bolton
3. Michael Bublé

And an unordered task list:

- [x] Create a sample markdown document
- [x] Add task lists to it
- [ ] Take a vacation

And a "mixed" task list:

- [ ] Steal underpants
- ?
- [ ] Profit!

And a nested list:

* Jackson 5
* Michael
* Tito
* Jackie
* Marlon
* Jermaine
* TMNT
* Leonardo
* Michelangelo
* Donatello
* Raphael
1 change: 1 addition & 0 deletions packages/example/src/pages/utilities/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Utilities
Loading

0 comments on commit 22ed1ae

Please sign in to comment.