-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #337 from primer/add-marketing-buttons
Add marketing buttons to primer-marketing-buttons
- Loading branch information
Showing
13 changed files
with
240 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.yml | ||
.github |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 GitHub Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,89 @@ | ||
# Primer Marketing CSS Buttons | ||
|
||
[![npm version](http://img.shields.io/npm/v/primer-marketing-buttons.svg)](https://www.npmjs.org/package/primer-marketing-buttons) | ||
[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) | ||
|
||
> Buttons are used for actions, like in forms, while textual hyperlinks are used for destinations, or moving from one page to another. | ||
This repository is a module of the full [primer-css][primer] repository. | ||
|
||
## Documentation | ||
|
||
<!-- %docs | ||
title: Marketing Buttons | ||
status: New Release | ||
--> | ||
|
||
Marketing buttons extend primer-core buttons with more color and fill styles. | ||
|
||
|
||
## Colors | ||
|
||
Marketing buttons are available in orange. | ||
|
||
```html | ||
<button class="btn btn-orange" type="button">Button button</button> | ||
``` | ||
|
||
## Outline button colors | ||
|
||
The `btn-outline` has also been extended with orange, purple, and green. | ||
|
||
```html | ||
<button class="btn btn-outline-orange" type="button">Button button</button> | ||
<a class="btn btn-outline-purple" href="#url" role="button">Link button</a> | ||
<button class="btn btn-outline-green" type="button">Button button</button> | ||
``` | ||
|
||
## Transparent button | ||
|
||
A button can also be transparent and displayed with a white border with `btn-transparent`. | ||
|
||
```html | ||
<div class="bg-gray-dark p-4 mt-4"> | ||
<button class="btn btn-transparent" type="button"> | ||
Button button | ||
<span class="Counter">12</span> | ||
</button> | ||
</div> | ||
``` | ||
|
||
<!-- %enddocs --> | ||
|
||
## Install | ||
|
||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-marketing-buttons` with this command. | ||
|
||
``` | ||
$ npm install --save primer-marketing-buttons | ||
``` | ||
|
||
## Usage | ||
|
||
The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this. | ||
|
||
```scss | ||
@import "primer-marketing-buttons/index.scss"; | ||
``` | ||
|
||
You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._ | ||
|
||
## Build | ||
|
||
For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` | ||
|
||
``` | ||
$ npm run build | ||
``` | ||
|
||
## License | ||
|
||
MIT © [GitHub](https://github.com/) | ||
|
||
[primer]: https://github.com/primer/primer | ||
[primer-support]: https://github.com/primer/primer-support | ||
[support]: https://github.com/primer/primer-support | ||
[docs]: http://primercss.io/ | ||
[npm]: https://www.npmjs.com/ | ||
[install-npm]: https://docs.npmjs.com/getting-started/installing-node | ||
[sass]: http://sass-lang.com/ |
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 @@ | ||
// support files | ||
@import "primer-support/index.scss"; | ||
@import "./lib/button.scss"; |
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 @@ | ||
.btn-orange { @include btn-solid($white, lighten($orange-500, 7.5%), darken($orange-500, 7.5%)); } | ||
|
||
.btn-outline-purple { @include btn-outline($purple); } | ||
.btn-outline-orange { @include btn-outline($orange); } | ||
.btn-outline-green { @include btn-outline($green); } | ||
|
||
@mixin btn-transparent-active { | ||
color: $gray-800; | ||
background-color: $white; | ||
background-image: none; | ||
border-color: $white; | ||
} | ||
|
||
.btn-transparent { | ||
color: $white; | ||
background-color: transparent; | ||
background-image: none; | ||
border: $border-width $border-style $white-fade-50; | ||
|
||
&:hover, | ||
&:active { | ||
@include btn-transparent-active; | ||
} | ||
} |
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,44 @@ | ||
{ | ||
"version": "0.0.1", | ||
"name": "primer-marketing-buttons", | ||
"description": "Buttons for marketing websites at GitHub", | ||
"homepage": "http://primercss.io/", | ||
"author": "GitHub, Inc.", | ||
"license": "MIT", | ||
"style": "build/build.css", | ||
"main": "build/index.js", | ||
"primer": { | ||
"category": "marketing", | ||
"module_type": "components" | ||
}, | ||
"files": [ | ||
"index.scss", | ||
"lib", | ||
"build" | ||
], | ||
"repository": "https://github.com/primer/primer-css/tree/master/modules/primer-marketing-buttons", | ||
"bugs": { | ||
"url": "https://github.com/primer/primer-css/issues" | ||
}, | ||
"scripts": { | ||
"test-docs": "../../script/test-docs", | ||
"build": "../../script/npm-run primer-module-build index.scss", | ||
"prepare": "npm run build", | ||
"lint": "../../script/lint-scss", | ||
"test": "../../script/npm-run-all build lint test-docs" | ||
}, | ||
"dependencies": { | ||
"primer-support": "4.4.1" | ||
}, | ||
"peerDependencies": { | ||
"primer-buttons": "2.4.1" | ||
}, | ||
"keywords": [ | ||
"css", | ||
"github", | ||
"primer", | ||
"primercss", | ||
"style", | ||
"buttons" | ||
] | ||
} |
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,21 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
|
||
storiesOf('Marketing buttons', module) | ||
.add('Button colors', () => ( | ||
<div className='p-4'> | ||
<button className="btn btn-orange mr-6" type="button">Button button</button> | ||
</div> | ||
)) | ||
.add('Outline colors', () => ( | ||
<div className='p-4'> | ||
<button className="btn btn-outline-orange mr-6" type="button">Button button</button> | ||
<a className="btn btn-outline-purple mr-6" href="#url" role="button">Link button</a> | ||
<button className="btn btn-outline-green mr-6" type="button">Button button</button> | ||
</div> | ||
)) | ||
.add('Transparent button', () => ( | ||
<div className="bg-gray-dark p-4 mt-4 mr-6"> | ||
<button className="btn btn-transparent mr-6" type="button">Button button</button> | ||
</div> | ||
)) |
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