diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index 06a1d1dd93..0000000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "docs/bower_components" -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9e4e7f3eb1..2b37f8a5da 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vendor/ .ruby-version _site/ node_modules/ +bower_components/ diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index 15269ddb06..0000000000 --- a/.hound.yml +++ /dev/null @@ -1,12 +0,0 @@ -scss: - enabled: true - config_file: scss/.scss-lint.yml - -ruby: - enabled: false - -coffee_script: - enabled: false - -java_script: - enabled: false diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..72630dab3d --- /dev/null +++ b/.npmignore @@ -0,0 +1,19 @@ +.bundle/config +bower_components/ +bin/ +_config.yml +.DS_Store +docs/ +Gemfile +Gemfile.lock +.git/ +.gitignore +Gruntfile.js +.hound.yml +vendor/ +.sass-cache/ +.ruby-version +node_modules/ +.sass-cache/ +.scss-lint.yml +_site/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 50451725c2..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,79 +0,0 @@ -## Contributing - -[fork]: https://github.com/github/primer/fork -[pr]: https://github.com/github/primer/compare -[style]: http://primercss.io/guidelines/ - -Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. - -After you open your first pull request, you will be asked to accept [this license agreement](https://cla.github.com/). Let us know in the PR if you have any hesitation or concerns. - -## Using the issue tracker - -The [issue tracker](https://github.com/primer/primer/issues) is the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) and [submitting pull requests](#pull-requests), but please respect the following restrictions: - -* Please **do not** use the issue tracker for personal support requests. -* Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others. -* Please **do not** open issues or pull requests regarding the code in [`Normalize`](https://github.com/necolas/normalize.css) (open them in their respective repositories). - -## Bug reports - -A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful, so thanks! - -Guidelines for bug reports: - -0. **Validate and lint your code** — [validate your HTML](http://html5.validator.nu) to ensure your problem isn't caused by a simple error in your own code. - -1. **Use the GitHub issue search** — check if the issue has already been reported. - -2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository. - -3. **Isolate the problem** — ideally create a [reduced test case](https://css-tricks.com/reduced-test-cases/) and a live example. [This JS Bin](http://jsbin.com/lefey/1/edit?html,output) is a helpful template. - -A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS experience the problem? Do other browsers show the bug differently? What would you expect to be the outcome? All these details will help people to fix any potential bugs. - -Example: - -> Short and descriptive example bug report title -> -> A summary of the issue and the browser/OS environment in which it occurs. If -> suitable, include the steps required to reproduce the bug. -> -> 1. This is the first step -> 2. This is the second step -> 3. Further steps, etc. -> -> `` - a link to the reduced test case -> -> Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits). - -## Feature requests - -Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. - -## Pull requests - -Good pull requests—patches, improvements, new features—are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. - -**Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. - -Adhering to the following process is the best way to get your work included in the project: - -1. Fork and clone the repository -2. Configure and install the dependencies: `bower install` -3. Create a new branch: `git checkout -b my-branch-name` -4. Make your change, add tests, and make sure the tests still pass -5. Push to your fork and [submit a pull request](https://help.github.com/articles/creating-a-pull-request/) -6. Pat your self on the back and wait for your pull request to be reviewed and merged. - -Here are a few things you can do that will increase the likelihood of your pull request being accepted: - -- Follow the [style guide][style]. -- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. -- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). - -## Resources - -- [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/) -- [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) -- [GitHub Help](https://help.github.com) diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..0c97120f0f --- /dev/null +++ b/Gemfile @@ -0,0 +1,11 @@ +source 'https://rubygems.org' + +require 'json' +require 'open-uri' +versions = JSON.parse(open('https://pages.github.com/versions.json').read) + +gem 'github-pages', versions['github-pages'] + +gem 'jekyll' +gem 'rouge' +gem 'sass' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..bc6324d7df --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,141 @@ +GEM + remote: https://rubygems.org/ + specs: + RedCloth (4.2.9) + activesupport (4.2.4) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.3.8) + blankslate (2.1.2.4) + bower (0.0.5) + multi_json + classifier-reborn (2.0.3) + fast-stemmer (~> 1.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.9.1.1) + colorator (0.1) + ethon (0.8.0) + ffi (>= 1.3.0) + execjs (2.6.0) + fast-stemmer (1.0.2) + ffi (1.9.10) + gemoji (2.1.0) + github-pages (39) + RedCloth (= 4.2.9) + github-pages-health-check (~> 0.2) + jekyll (= 2.4.0) + jekyll-coffeescript (= 1.0.1) + jekyll-feed (= 0.3.1) + jekyll-mentions (= 0.2.1) + jekyll-redirect-from (= 0.8.0) + jekyll-sass-converter (= 1.3.0) + jekyll-sitemap (= 0.8.1) + jemoji (= 0.5.0) + kramdown (= 1.5.0) + liquid (= 2.6.2) + maruku (= 0.7.0) + mercenary (~> 0.3) + pygments.rb (= 0.6.3) + rdiscount (= 2.1.7) + redcarpet (= 3.3.2) + terminal-table (~> 1.4) + github-pages-health-check (0.5.3) + addressable (~> 2.3) + net-dns (~> 0.8) + public_suffix (~> 1.4) + typhoeus (~> 0.7) + html-pipeline (1.9.0) + activesupport (>= 2) + nokogiri (~> 1.4) + i18n (0.7.0) + jekyll (2.4.0) + classifier-reborn (~> 2.0) + colorator (~> 0.1) + jekyll-coffeescript (~> 1.0) + jekyll-gist (~> 1.0) + jekyll-paginate (~> 1.0) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 1.1) + kramdown (~> 1.3) + liquid (~> 2.6.1) + mercenary (~> 0.3.3) + pygments.rb (~> 0.6.0) + redcarpet (~> 3.1) + safe_yaml (~> 1.0) + toml (~> 0.1.0) + jekyll-coffeescript (1.0.1) + coffee-script (~> 2.2) + jekyll-feed (0.3.1) + jekyll-gist (1.3.4) + jekyll-mentions (0.2.1) + html-pipeline (~> 1.9.0) + jekyll (~> 2.0) + jekyll-paginate (1.1.0) + jekyll-redirect-from (0.8.0) + jekyll (>= 2.0) + jekyll-sass-converter (1.3.0) + sass (~> 3.2) + jekyll-sitemap (0.8.1) + jekyll-watch (1.3.0) + listen (~> 3.0) + jemoji (0.5.0) + gemoji (~> 2.0) + html-pipeline (~> 1.9) + jekyll (>= 2.0) + json (1.8.3) + kramdown (1.5.0) + liquid (2.6.2) + listen (3.0.3) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + maruku (0.7.0) + mercenary (0.3.5) + mini_portile (0.6.2) + minitest (5.8.1) + multi_json (1.11.2) + net-dns (0.8.0) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + parslet (1.5.0) + blankslate (~> 2.0) + posix-spawn (0.3.11) + public_suffix (1.5.1) + pygments.rb (0.6.3) + posix-spawn (~> 0.3.6) + yajl-ruby (~> 1.2.0) + rb-fsevent (0.9.6) + rb-inotify (0.9.5) + ffi (>= 0.5.0) + rdiscount (2.1.7) + redcarpet (3.3.2) + rouge (1.10.1) + safe_yaml (1.0.4) + sass (3.4.18) + terminal-table (1.5.2) + thread_safe (0.3.5) + toml (0.1.2) + parslet (~> 1.5.0) + typhoeus (0.8.0) + ethon (>= 0.8.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + yajl-ruby (1.2.1) + +PLATFORMS + ruby + +DEPENDENCIES + bower + github-pages (= 39) + jekyll + json + rouge + sass + +BUNDLED WITH + 1.10.5 diff --git a/Gruntfile.js b/Gruntfile.js index a1d6dc51dc..3a524563e8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,60 +13,17 @@ module.exports = function(grunt) { }, dist: { files: { - 'css/primer.css': 'scss/primer.scss' + 'assets/css/origin.css': 'assets/scss/origin.scss' } } }, - // Handle vendor prefixing - postcss: { - options: { - processors: [ - require('autoprefixer-core')({ browsers: ['last 2 versions', 'ie 8', 'ie 9'] }) - ] - }, - dist: { - src: 'css/*.css' - }, - docs: { - src: '_site/*.css' - } - }, - - // Runs CSS reporting - parker: { - options: { - metrics: [ - 'TotalStylesheets', - 'TotalStylesheetSize', - 'TotalRules', - 'TotalSelectors', - 'TotalIdentifiers', - 'TotalDeclarations', - 'SelectorsPerRule', - 'IdentifiersPerSelector', - 'SpecificityPerSelector', - 'TopSelectorSpecificity', - 'TopSelectorSpecificitySelector', - 'TotalIdSelectors', - 'TotalUniqueColours', - 'TotalImportantKeywords', - 'TotalMediaQueries' - ], - file: "css/.primer-stats.md", - usePackage: true - }, - src: [ - 'css/*.css' - ] - }, - // Build tooling watch: { sass: { - files: ['scss/**/*.scss', 'docs/docs.scss'], - tasks: ['sass', 'postcss', 'parker'] + files: ['assets/scss/*.scss', 'assets/scss/**/*.scss', 'assets/scss/**/**/*.scss'], + tasks: ['sass'] } }, @@ -78,6 +35,24 @@ module.exports = function(grunt) { } }, + browserSync: { + dev: { + bsFiles: { + src : [ + '_site/*.*', + '_site/**/*.*', + '_site/**/**/*.*', + '_site/**/**/**/*.*', + '_site/**/**/**/**/*.*', + '_site/**/**/**/**/**/*.*' + ] + }, + options: { + proxy: "localhost:4001/origin/" + } + } + }, + buildcontrol: { options: { dir: '_site', @@ -87,7 +62,7 @@ module.exports = function(grunt) { }, pages: { options: { - remote: 'git@github.com:primer/primer.git', + remote: 'git@github.com:fac/origin.git', branch: 'gh-pages' } } @@ -95,16 +70,15 @@ module.exports = function(grunt) { }); // Load dependencies - grunt.loadNpmTasks('grunt-postcss'); + grunt.loadNpmTasks('grunt-browser-sync'); grunt.loadNpmTasks('grunt-build-control'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-jekyll'); - grunt.loadNpmTasks('grunt-parker'); grunt.loadNpmTasks('grunt-sass'); // Generate and format the CSS - grunt.registerTask('default', ['sass', 'jekyll', 'postcss', 'parker']); + grunt.registerTask('default', ['browserSync']); // Publish to GitHub - grunt.registerTask('publish', ['jekyll', 'postcss:docs', 'buildcontrol:pages']); + grunt.registerTask('publish', ['jekyll', 'buildcontrol:pages']); }; diff --git a/MAINTAINING.md b/MAINTAINING.md deleted file mode 100644 index fad610c729..0000000000 --- a/MAINTAINING.md +++ /dev/null @@ -1,33 +0,0 @@ -# Maintaining - -Steps for updating and releasing changes to Primer and it's site. - -## Versioning - -Primer follows the semantic versioning approach: - -- Bug fixes and docs updates are patch releases, so `1.0.x`. -- New additions are minor updates, so `1.x.x`. -- Deleting or rewriting anything are major updates, so `x.x.x`. - -## Changelogs and milestones - -Changelogs are handled with dedicated tracking issues ([see example](https://github.com/primer/primer/issues/108)). When starting work on a new release: - -1. Open a new milestone. -2. Open a new tracking issue and immediately lock it. (No comments are needed, ship lists are just for us.) -3. As you close issues and merge pull requests, add a link to those threads to the tracking issue. - -When the release and milestone are about ready to ship, move on the the releasing flow. - -## Releasing - -Have a new version to release? Hell yeah, let's do it. - -1. Bump the version numbers in `_config.yml` for our docs and `package.json` for dependency management. -2. Run `$ grunt` to generate the latest compiled CSS and Parker stats. -3. Recompile Jekyll for the latest docs changes. -4. Punt any remaining open issues and PRs on the milestone to the next milestone, then close that milestone. -5. Head to and create a new release. Title it `vX.X.X` and post the changelog to the body. -6. Run `$ grunt publish` to push the latest docs and CSS changes to . -7. Rejoice! diff --git a/README.md b/README.md index 51c1b4d73a..3859086e90 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,93 @@ -# Primer +# Origin -Primer is the CSS toolkit that powers GitHub's front-end design. It's purposefully limited to common components to provide our developers with the most flexibility, and to keep GitHub uniquely *GitHubby*. It's built with SCSS and available via Bower, so it's easy to include all or part of it within your own project. +Origin is FreeAgent’s internal CSS framework. We’re a growing team working across a range of different projects and codebases, and making CSS work at scale is hard. Agreed principles, approaches, and patterns mean we can do better work faster. That’s what Origin gives us. -[**Read the Primer documentation**](http://primercss.io) to learn more. +Origin consumes our [CSS utilities](https://github.com/fac/fa-css-utilities) and provides some global UI components. It also documents our [principles](http://fac.github.io/origin/principles/) and HTML & CSS [code style](http://fac.github.io/origin/code-style/). We use it in our desktop app, mobile apps, website, and a bunch of other projects. + +[**Read the Origin documentation**](http://fac.github.io/origin/) to learn more. -_**Heads up!** We love open source, but Primer is unlikely to add new features that are not used in GitHub.com. It's first and foremost our CSS toolkit. We really love to share though, so hopefully that means we're still friends <3._ ## Contents - [Install](#install) -- [Usage](#usage) -- [Documentation](#documentation) - - [Dependencies](#dependencies) - - [Running locally](#running-locally) +- [Structure](#structure) + - [Documentation](#documentation) - [Publishing](#publishing) - - [Primer stats](#primer-stats) -- [Updating](#updating) +- [Implementing Origin into a project](#implementing-origin-into-a-project) +- [Development](#development) + - [Developing ideas locally](#developing-ideas-locally) - [Contributing](#contributing) -- [Versioning](#versioning) - [License](#license) + ## Install -### Manually +Following these steps will install Origin and it’s docs locally, and allow you to push documentation changes to GitHub Pages. -Download the [latest release](https://github.com/primer/primer/releases/latest) and copy the SCSS files over to your own project. Once your files are in place, jump to the [usage guidelines](#usage) for including Primer into your own CSS. +**If you want to implement Origin into a project and don’t want the documentation, [follow these instructions](#implementing-origin-into-a-project)** -### Bower +Prerequisites: Ruby, [Bundler](http://bundler.io/), [Node.js](http://nodejs.org/download/) +```bash +$ git clone git@github.com:fac/origin.git +$ cd origin +$ chruby ruby-2.1.2 (or whatever your non-system version of Ruby is) +$ bundle install +$ npm install +$ npm install -g grunt-cli (if you don’t already have Grunt installed) +$ npm install -g bower (if you don’t already have Bower installed) +$ bower install ``` -$ bower install primer-css --save -``` - -### Things to know -**Hey, GitHubbers!** For GitHub.com, you'll need to `cd` into `vendor/assets` and run `bower install` there. Be sure to commit and push all the changes, including the `bower.json` and everything under `bower_components`. +Then start a local Jekyll server: -## Usage - -Once included, simply `@import` either the master SCSS file, or the individual files as you need them. +```bash +$ bundle exec jekyll serve +``` -```scss -// Example: All of Primer -@import "primer-css/scss/primer"; +Now open a new terminal window and start Browsersync: -// Example: Individual files -@import "primer-css/scss/variables"; -@import "primer-css/scss/mixins"; -@import "primer-css/scss/base"; +```bash +$ grunt ``` -## Documentation +A new browser tab should open to `http://localhost:3001/origin/`. The docs don't run at root because when published to GitHub Pages they lives at `/origin`. There is an established workaround for this, but it’s not applicable to sites where the Jekyll source is anywhere other than the root directory, and ours lives in `/docs`. -Primer's documentation is built with Jekyll and published to `http://primercss.io` via the `gh-pages` branch. -### Dependencies +## Structure -You'll need the following installed: +Very little of this repository is actually part of the [`origin-css`](https://www.npmjs.com/package/origin-css) npm package. Only: -- Latest Jekyll (minimum v2.2.0): `$ gem install jekyll` -- Latest Rouge: `$ gem install rouge` -- Latest Sass: `$ gem install sass` -- Latest Grunt CLI: `$ npm install -g grunt-cli` -- [Node.js and npm](http://nodejs.org/download/) +``` +. +├── assets +| ├── fonts +| └── scss +├── LICENSE.md +├── package.json +└── README.md +``` -Chances are you have all this already if you work on `github/github` or similar projects. If you have all those set up, now you can install the dependencies: +These are the only files needed to implement Origin in a project, so that’s all npm needs to know about. [`.npmignore`](https://github.com/fac/origin/blob/master/.npmignore) defines what’s hidden from npm in the same way a `.gitignore` file does. -```bash -$ npm install -$ bower install -``` +If you want to make changes to Origin, it’s these files you want to change. The rest of the repository is dedicated to the documentation. -### Running locally +### Documentation -From the Terminal, start a local Jekyll server: +Origin’s documentation is built with Jekyll and Grunt. It can be run locally, and is published to [http://fac.github.io/origin/](http://fac.github.io/origin/) via the [`gh-pages`](https://github.com/fac/origin/tree/gh-pages) branch. -```bash -$ jekyll serve -``` +Aside from Jekyll’s [`_config.yml`](https://github.com/fac/origin/blob/master/_config.yml) and Grunt’s [`Gruntfile.js`](https://github.com/fac/origin/blob/master/Gruntfile.js), all files related to documentation live in [`/docs`](https://github.com/fac/origin/tree/master/docs). -Open a second Terminal tab to automatically recompile the Sass files, run autoprefixer, and update our [Primer stats file](#primer-stats): +Here’s where things get a bit inception-y: **Origin’s documentation _uses Origin_ to document Origin**. -```bash -$ grunt watch -``` +The [`/docs/assets`](https://github.com/fac/origin/tree/master/docs/assets) directory contains many of the same files as the root `/assets` directory (the one included in the npm package). In this sense, the Origin docs are a good example of how you might implement Origin into a project. + +But the real purpose of the docs (aside from the obvious) is to give us a sandbox for trying new ideas and approaches before considering them for deployment. It’s our “kitchen sink” view of utilities and components. -Alternatively, you can manually run `grunt` and `jekyll serve` when needed. ### Publishing -Use the included Grunt task to generate and publish Primer's docs to the `gh-pages` branch. +Use the included Grunt task to generate and publish Origin’s docs to the `gh-pages` branch. ```bash $ grunt publish @@ -97,55 +95,65 @@ $ grunt publish This takes the `_site` directory, generates it's own Git repository there, and publishes the contents to the `gh-pages` branch here on GitHub. Changes are reflected in the hosted docs within a minute or so. -### Primer stats -When compiling or watching the Sass files, Primer will automatically generate a `.primer-stats.md` file. This is tracked in the Git repository to provide us historical and contextual information on the changes we introduce. For example, we'll know when the number of selectors or declarations rises sharply within a single change. +## Implementing Origin into a project -## Updating +These instructions assume you’re implementing Origin into a new or existing project. Origin is installed via npm, and assumes your project already has mechanisms in place for compiling Sass. -Within `bower.json`, update to a new release by changing the version number that follows the `#` in the dependency URL. +Requirements: [Node.js and npm](http://nodejs.org/download/). -```json -{ - "name": "myapp", - "dependencies": { - "primer-css": "x.x.x" - } -} +```bash +$ cd +$ npm install origin-css --save ``` -To pull down the updated package, `cd` into `vendor/assets`, and run `bower install`. +This will add the Origin files to a new `/origin-css` directory inside the `/node_modules` directory at the root of your project, and save `origin-css` as a dependency in your `package.json` file. If npm isn’t yet being used in your project, running the above command will create the `/node_modules` directory too. You’ll want to [create a package](https://docs.npmjs.com/cli/init) to manage your npm dependencies. -``` -$ cd vendor/assets -$ bower install -``` +After installing, do the following: + +1. Copy the contents of [/origin-css/assets/scss/local](https://github.com/fac/origin/tree/master/assets/scss/local) to your project’s stylesheet directory. Just the contents, not the directory itself. +2. Use `origin.scss` as your master stylesheet, or copy it’s contents into your existing master stylesheet. You’ll need to change the paths to the global Sass partials if the location of your stylesheets directory isn’t the standard Rails `app/assets/stylesheets`. -Check in `bower.json` and all changes under `vendor/assets/bower_components`. ## Development -Development of Primer happens in our primary branch, `master`. For stable versions, see the [releases page](https://github.com/primer/primer/releases). `master` will always be up to date with the latest changes, including those which have yet to be released. +Development of Origin happens in our primary branch, `master`. For stable versions, see the [releases page](https://github.com/fac/origin/releases). `master` will always be up to date with the latest changes, including those which have yet to be released. + +### Developing ideas locally + +As mentioned [above](#documentation), Origin’s documentation _uses_ Origin. The [`/docs`](https://github.com/fac/origin/tree/master/docs) directory is the place to experiment with new ideas before considering adding any of them to the root [`/assets`](https://github.com/fac/origin/tree/master/assets) directory. + +It’s also possible to try out new ideas for Origin in any other projects where it’s implemented. npm provides a way to point to your _local version of Origin_ instead of referencing the one installed by npm. This means you could, for example, trial changing the `background-color` of a button in Origin and see the effect it has in your app without actually having to push a new version of the Origin package to npm. + +[How to symlink a package folder](https://docs.npmjs.com/cli/link) + ## Contributing -By contributing to Primer, you agree to the terms presented in [this license agreement](https://cla.github.com/). *More information will be provided here soon.* +All team members should be contributing back to this repo in order to improve it. All HTML and CSS should conform to the [style guidelines](http://fac.github.io/origin/code-style/). + +Editor preferences are available in the [editor config](https://github.com/fac/origin/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at . -When contributing changes to Primer, be sure to do the following steps when opening a pull request: +The process: -1. Bump the version number in `bower.json` (it's purely placebo right now, but it's good habit) and `package.json`. -2. Run `grunt` and commit the changes. This compiles the SCSS to CSS so we can do basic analysis on the number of selectors, file size, etc. +#### Branch off, make changes, create a PR -In addition, please read through our [contributing guidelines](https://github.com/primer/primer/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. +1. Make sure you're up to date with the master branch (`git fetch; git pull origin master`) +2. Branch off master (`git checkout -b `) and make your changes +3. Increment the version numbers in [_config.yml](https://github.com/fac/origin/blob/master/_config.yml) and [package.json](https://github.com/fac/origin/blob/master/package.json). Generally: backwards-compatible fixes and smaller amendments to existing code are patches, new components and breaking changes count as minor releases, and full rewrites are major releases. See [semver.org](http://semver.org/) for detailed guidance. +4. Push up your changes (`git push origin `) and write a [helpful pull request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) describing your changes -All HTML and CSS should conform to the [style guidelines](http://primercss.io/guidelines). +#### Get your PR reviewed, merge to master, create new release -Editor preferences are available in the [editor config](https://github.com/primer/primer/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at . +5. Ask a fellow designer or engineer to review your changes. Make any required changes, then merge your branch into master: `git checkout master; git merge --no-ff ` +6. Push up the new version of master (`git push origin master`). +7. [Create a new release](https://help.github.com/articles/creating-releases/) with a useful description. Your original PR is probably a good starting point. **If you’re making breaking changes, provide guidance in the release notes about what people will have to change in their projects** +8. [Publish the NPM package](https://docs.npmjs.com/getting-started/publishing-npm-packages) (`npm publish`). If you don't yet have access to update the npm package, have someone in the design team [add you as an owner](https://docs.npmjs.com/cli/owner). -## Versioning +#### Let people know, consider upgrading other projects -For transparency into our release cycle and in striving to maintain backward compatibility, Primer is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible. +If this a major or minor release, let people in the #design and/or #dev Slack channels know by linking to the release. Consider bringing other projects up to date with your new release, especially [Origin](https://github.com/fac/origin). ## License -Created by and copyright GitHub, Inc. Released under the [MIT license](LICENSE.md). +Origin is based on a fork of [Primer](https://github.com/primer/primer), created by and copyright of GitHub, Inc. Released under the [MIT license](LICENSE.md). diff --git a/_config.yml b/_config.yml index b62055d728..e713e22e4c 100644 --- a/_config.yml +++ b/_config.yml @@ -1,18 +1,26 @@ +# Directory where the site will be built from +source: docs + +permalink: pretty + +port: 4001 + +# Because the deployed site doesn’t live at the root fac.github.io URL; it lives +# at fac.github.io/origin +baseurl: "/origin" + +# Markdown processors markdown: kramdown highlighter: rouge - kramdown: auto_ids: true -permalink: pretty -source: docs -baseurl: "" - -version: 2.3.3 +version: 0.2.1 sass: - sass_dir: ../ + # Directory points to root allowing `@import` of .scss files from anywhere + sass_dir: assets/scss style: compressed github: - repo: https://github.com/primer/primer + repo: https://github.com/fac/origin diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-Black.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Black.eot new file mode 100755 index 0000000000..747914e3f6 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Black.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-BlackIt.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-BlackIt.eot new file mode 100755 index 0000000000..a56b5c32dd Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-BlackIt.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-Bold.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Bold.eot new file mode 100755 index 0000000000..e9f423425c Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Bold.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-BoldIt.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-BoldIt.eot new file mode 100755 index 0000000000..d375ef51c6 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-BoldIt.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-ExtraLight.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-ExtraLight.eot new file mode 100755 index 0000000000..f4dbef9022 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-ExtraLight.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-ExtraLightIt.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-ExtraLightIt.eot new file mode 100755 index 0000000000..da735de357 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-ExtraLightIt.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-It.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-It.eot new file mode 100755 index 0000000000..55ad8562ee Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-It.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-Light.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Light.eot new file mode 100755 index 0000000000..ea7f671316 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Light.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-LightIt.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-LightIt.eot new file mode 100755 index 0000000000..d7cb9a72fd Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-LightIt.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-Regular.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Regular.eot new file mode 100755 index 0000000000..ba7f8d9515 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Regular.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-Semibold.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Semibold.eot new file mode 100755 index 0000000000..2f7a52c454 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-Semibold.eot differ diff --git a/assets/fonts/SourceSansPro/EOT/SourceSansPro-SemiboldIt.eot b/assets/fonts/SourceSansPro/EOT/SourceSansPro-SemiboldIt.eot new file mode 100755 index 0000000000..d8504fed78 Binary files /dev/null and b/assets/fonts/SourceSansPro/EOT/SourceSansPro-SemiboldIt.eot differ diff --git a/assets/fonts/SourceSansPro/LICENSE.txt b/assets/fonts/SourceSansPro/LICENSE.txt new file mode 100644 index 0000000000..07efc6de21 --- /dev/null +++ b/assets/fonts/SourceSansPro/LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-Black.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Black.otf new file mode 100755 index 0000000000..0c25f3d9b7 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Black.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-BlackIt.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-BlackIt.otf new file mode 100755 index 0000000000..da3504c68c Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-BlackIt.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-Bold.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Bold.otf new file mode 100755 index 0000000000..98dbee74d5 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Bold.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-BoldIt.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-BoldIt.otf new file mode 100755 index 0000000000..6600c86319 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-BoldIt.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-ExtraLight.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-ExtraLight.otf new file mode 100755 index 0000000000..f885ce7f61 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-ExtraLight.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-ExtraLightIt.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-ExtraLightIt.otf new file mode 100755 index 0000000000..f932024272 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-ExtraLightIt.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-It.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-It.otf new file mode 100755 index 0000000000..2d627d9cf9 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-It.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-Light.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Light.otf new file mode 100755 index 0000000000..159979f600 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Light.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-LightIt.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-LightIt.otf new file mode 100755 index 0000000000..e3d49b5fd1 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-LightIt.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-Regular.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Regular.otf new file mode 100755 index 0000000000..bdcfb27a4f Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Regular.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-Semibold.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Semibold.otf new file mode 100755 index 0000000000..fffdbafeb7 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-Semibold.otf differ diff --git a/assets/fonts/SourceSansPro/OTF/SourceSansPro-SemiboldIt.otf b/assets/fonts/SourceSansPro/OTF/SourceSansPro-SemiboldIt.otf new file mode 100755 index 0000000000..e90515b3e1 Binary files /dev/null and b/assets/fonts/SourceSansPro/OTF/SourceSansPro-SemiboldIt.otf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-Black.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Black.ttf new file mode 100755 index 0000000000..9c9b5cb7f0 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Black.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-BlackIt.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-BlackIt.ttf new file mode 100755 index 0000000000..294ce5abe8 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-BlackIt.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-Bold.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Bold.ttf new file mode 100755 index 0000000000..5d65c93242 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Bold.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-BoldIt.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-BoldIt.ttf new file mode 100755 index 0000000000..3decd13007 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-BoldIt.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-ExtraLight.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-ExtraLight.ttf new file mode 100755 index 0000000000..253eafa378 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-ExtraLight.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-ExtraLightIt.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-ExtraLightIt.ttf new file mode 100755 index 0000000000..00d7e9a7aa Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-ExtraLightIt.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-It.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-It.ttf new file mode 100755 index 0000000000..f7af537759 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-It.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-Light.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Light.ttf new file mode 100755 index 0000000000..83a0a33666 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Light.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-LightIt.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-LightIt.ttf new file mode 100755 index 0000000000..f18827985e Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-LightIt.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-Regular.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Regular.ttf new file mode 100755 index 0000000000..44486cdc67 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Regular.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-Semibold.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Semibold.ttf new file mode 100755 index 0000000000..86b00c067e Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-Semibold.ttf differ diff --git a/assets/fonts/SourceSansPro/TTF/SourceSansPro-SemiboldIt.ttf b/assets/fonts/SourceSansPro/TTF/SourceSansPro-SemiboldIt.ttf new file mode 100755 index 0000000000..13d66a1fc4 Binary files /dev/null and b/assets/fonts/SourceSansPro/TTF/SourceSansPro-SemiboldIt.ttf differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Black.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Black.otf.woff new file mode 100755 index 0000000000..f1a663a7ed Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Black.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-BlackIt.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-BlackIt.otf.woff new file mode 100755 index 0000000000..1d7dfbdb29 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-BlackIt.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Bold.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Bold.otf.woff new file mode 100755 index 0000000000..6700893c22 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Bold.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-BoldIt.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-BoldIt.otf.woff new file mode 100755 index 0000000000..d5e4a0ff9f Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-BoldIt.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-ExtraLight.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-ExtraLight.otf.woff new file mode 100755 index 0000000000..559b740812 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-ExtraLight.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff new file mode 100755 index 0000000000..e8fbeb8fe6 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-ExtraLightIt.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-It.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-It.otf.woff new file mode 100755 index 0000000000..4b8af41547 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-It.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Light.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Light.otf.woff new file mode 100755 index 0000000000..10490ec577 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Light.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-LightIt.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-LightIt.otf.woff new file mode 100755 index 0000000000..13532d7d39 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-LightIt.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Regular.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Regular.otf.woff new file mode 100755 index 0000000000..04739e7fba Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Regular.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Semibold.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Semibold.otf.woff new file mode 100755 index 0000000000..17d744d1b1 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-Semibold.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff new file mode 100755 index 0000000000..a5b5e1e1d1 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/OTF/SourceSansPro-SemiboldIt.otf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Black.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Black.ttf.woff new file mode 100755 index 0000000000..b7e8620092 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Black.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-BlackIt.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-BlackIt.ttf.woff new file mode 100755 index 0000000000..c3314b1ef0 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-BlackIt.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Bold.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Bold.ttf.woff new file mode 100755 index 0000000000..d1d40f840f Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Bold.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-BoldIt.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-BoldIt.ttf.woff new file mode 100755 index 0000000000..ef6ff514d3 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-BoldIt.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-ExtraLight.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-ExtraLight.ttf.woff new file mode 100755 index 0000000000..1e6c94d9eb Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-ExtraLight.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-ExtraLightIt.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-ExtraLightIt.ttf.woff new file mode 100755 index 0000000000..7a408b1ec7 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-ExtraLightIt.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-It.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-It.ttf.woff new file mode 100755 index 0000000000..4d54bc9571 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-It.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Light.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Light.ttf.woff new file mode 100755 index 0000000000..1706d57d3c Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Light.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-LightIt.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-LightIt.ttf.woff new file mode 100755 index 0000000000..87378d6c60 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-LightIt.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Regular.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Regular.ttf.woff new file mode 100755 index 0000000000..460ab12a63 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Regular.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Semibold.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Semibold.ttf.woff new file mode 100755 index 0000000000..43379631b2 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-Semibold.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-SemiboldIt.ttf.woff b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-SemiboldIt.ttf.woff new file mode 100755 index 0000000000..232c2048ae Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF/TTF/SourceSansPro-SemiboldIt.ttf.woff differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Black.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Black.otf.woff2 new file mode 100755 index 0000000000..d6f4b60e63 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Black.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-BlackIt.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-BlackIt.otf.woff2 new file mode 100755 index 0000000000..c52b3c8000 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-BlackIt.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Bold.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Bold.otf.woff2 new file mode 100755 index 0000000000..7d7f34b9e9 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Bold.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-BoldIt.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-BoldIt.otf.woff2 new file mode 100755 index 0000000000..4d14ef7ff0 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-BoldIt.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-ExtraLight.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-ExtraLight.otf.woff2 new file mode 100755 index 0000000000..bdb21cb439 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-ExtraLight.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-ExtraLightIt.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-ExtraLightIt.otf.woff2 new file mode 100755 index 0000000000..aee47e3513 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-ExtraLightIt.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-It.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-It.otf.woff2 new file mode 100755 index 0000000000..00e212c55e Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-It.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Light.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Light.otf.woff2 new file mode 100755 index 0000000000..2dd7ca3b11 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Light.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-LightIt.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-LightIt.otf.woff2 new file mode 100755 index 0000000000..5ee08bea99 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-LightIt.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Regular.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Regular.otf.woff2 new file mode 100755 index 0000000000..d76e39091f Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Regular.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Semibold.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Semibold.otf.woff2 new file mode 100755 index 0000000000..8c27c1840e Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-Semibold.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-SemiboldIt.otf.woff2 b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-SemiboldIt.otf.woff2 new file mode 100755 index 0000000000..f963d7810d Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/OTF/SourceSansPro-SemiboldIt.otf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Black.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Black.ttf.woff2 new file mode 100755 index 0000000000..c90d078406 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Black.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-BlackIt.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-BlackIt.ttf.woff2 new file mode 100755 index 0000000000..b87e22c41b Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-BlackIt.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Bold.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Bold.ttf.woff2 new file mode 100755 index 0000000000..0f46f3e833 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Bold.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-BoldIt.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-BoldIt.ttf.woff2 new file mode 100755 index 0000000000..8007df6df3 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-BoldIt.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-ExtraLight.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-ExtraLight.ttf.woff2 new file mode 100755 index 0000000000..b715f27408 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-ExtraLight.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-ExtraLightIt.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-ExtraLightIt.ttf.woff2 new file mode 100755 index 0000000000..d8f9d29d4a Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-ExtraLightIt.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-It.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-It.ttf.woff2 new file mode 100755 index 0000000000..a00852641f Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-It.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Light.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Light.ttf.woff2 new file mode 100755 index 0000000000..d8b610ad76 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Light.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-LightIt.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-LightIt.ttf.woff2 new file mode 100755 index 0000000000..e0eebac827 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-LightIt.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2 new file mode 100755 index 0000000000..0dd3464c74 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Semibold.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Semibold.ttf.woff2 new file mode 100755 index 0000000000..2526d2e1b6 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-Semibold.ttf.woff2 differ diff --git a/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-SemiboldIt.ttf.woff2 b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-SemiboldIt.ttf.woff2 new file mode 100755 index 0000000000..606935af08 Binary files /dev/null and b/assets/fonts/SourceSansPro/WOFF2/TTF/SourceSansPro-SemiboldIt.ttf.woff2 differ diff --git a/assets/scss/global/components/_button.scss b/assets/scss/global/components/_button.scss new file mode 100644 index 0000000000..e6d77d63f4 --- /dev/null +++ b/assets/scss/global/components/_button.scss @@ -0,0 +1,84 @@ +/** + * Buttons + */ + +/** + * Remove the default Webkit glow to more closely mimic native mobile apps + */ + +button:focus { + outline: none; +} + +/** + * Vanilla styles for any element with .Button class + */ + +.Button { + border-style: solid; + border-width: 1px; + border-color: rgba(0,0,0,0.08) rgba(0,0,0,0.15) rgba(0,0,0,0.28) rgba(0,0,0,0.15); + cursor: pointer; + display: inline-block; + text-align: center; + @include border-radius(default); + @include box-shadow(0, 1px, 0, rgba(0,0,0,0.05)); + @include font-size(default); + @include font-weight(semi-bold); + @include linear-gradient(#fff,darken(#fff,6%)); + @include padding-bottom(3); + @include padding-left(6); + @include padding-right(6); + @include padding-top(3); + @include tap-highlight(none); + @include text-color(base); + @include user-select(none); +} + +.Button:active, +.Button:focus, +.Button:hover { + background: darken(#fff, 6%); + border-color: rgba(0, 0, 0, 0.08); + color: darken($color--base, 10%); + text-decoration: none; + @include box-shadow(0, 0, 0, rgba(0, 0, 0, 0)); +} + +/** + * Button disabled state + * + * 'disabled' HTML attribute should also be applied to the -Link button -{% endexample %} - -You can find them in two sizes: the default `.btn` and the smaller `.btn-sm`. - -{% example html %} - - -{% endexample %} - -## Primary - -Primary buttons are green and are used to indicate the *primary* action on a page. When you need your buttons to stand out, use `.btn.btn-primary`. You can use it with both button sizes—just add `.btn-primary`. - -{% example html %} - - -{% endexample %} - -## Danger - -Danger buttons are red. They help reiterate that the intended action is important or potentially dangerous (e.g., deleting a repo or transferring ownership). Similar to the primary buttons, just add `.btn-danger`. - -{% example html %} - - -{% endexample %} - -## Outline - -Outline buttons downplay an action as they appear like boxy links. Just add `.btn-outline` and go. - -{% example html %} - - -{% endexample %} - -## Disabled state - -Disable ` -Disabled button -{% endexample %} - -Similar styles are applied to primary, danger, and outline buttons: - -{% example html %} - -Disabled button -{% endexample %} - -{% example html %} - -Disabled button -{% endexample %} - -{% example html %} - -Disabled button -{% endexample %} - -## Block buttons - -Make any button full-width by adding `.btn-block`. It adds `width: 100%;`, changes the `display` from `inline-block` to `block`, and centers the button text. - -{% example html %} -

-

-{% endexample %} - -## With counts - -You can easily append a count to a **small button**. Add the `.with-count` class to the `.btn-sm` and then add the `.social-count` after the button. - -**Be sure to clear the float added by the additional class.** - -{% example html %} - -{% endexample %} - -You can also use the [counter](../utilities/#counter) component within buttons: - -{% example html %} - - - - - - - -{% endexample %} - -## Button groups - -Have a hankering for a series of buttons that are attached to one another? Wrap them in a `.btn-group` and the buttons will be rounded and spaced automatically. - -{% example html %} -
- - - -
- -
- - - -
- -
- - - -
-{% endexample %} - -Add `.button_to` to `
`s within `.btn-group`s for proper spacing and rounded corners. - -**Heads up!** This class name is inconsistent and will change in the next major version. - -{% example html %} -
- - - - - -
-{% endexample %} - -## Hidden text button - -Use `.hidden-text-expander` to indicate and toggle hidden text. - -{% example html %} - - - -{% endexample %} - -You can also make the expander appear inline by adding `.inline`. diff --git a/docs/colors.md b/docs/colors.md deleted file mode 100644 index cc325d93fb..0000000000 --- a/docs/colors.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: page -title: Colors ---- - -The look and feel of our company and product relies on using a handful of specific colors that help convey meaning and purpose. - -### Branding - -
-
-
-
-
- -### Grayscale - -
-
-
diff --git a/docs/components/button.md b/docs/components/button.md new file mode 100644 index 0000000000..424faeccde --- /dev/null +++ b/docs/components/button.md @@ -0,0 +1,165 @@ +--- +layout: page +title: Button +--- + +* Will be replaced with the ToC, excluding the "Contents" header +{:toc} + + +## Default buttons + +When using a ` +Link button +{% endexample %} + +You can find them in three sizes: standard `.Button`, `.Button--large`, and `.Button--small`. + +{% example html %} + + + +{% endexample %} + + +## Primary + +Primary buttons are used to indicate the **one** primary action on a view/page. Small buttons can also be given primary styling; remember to list the classes in alphabetical order. + +{% example html %} + + + +{% endexample %} + + +## Negative + +Negative buttons have red label text on `:hover`, `:active`, and `:focus` states. They help reiterate that the intended action can have negative consequences (e.g. disabling or cancelling something). + +{% example html %} + + + +{% endexample %} + + +## Danger + +Danger buttons always have red label text. They help reiterate that the intended action is potentially dangerous (e.g. deleting something). + +{% example html %} + + + +{% endexample %} + + +## Neutral + +Neutral buttons have gray label text. They’re useful when a button shouldn’t command as much attention as normal. + +{% example html %} + + + +{% endexample %} + + +## Outline + +Outline buttons reduce the overall emphasis of a button in an interace, while still retaining the same functionality. + +{% example html %} + + + +{% endexample %} + + +## Disabled state + +Disable ` +Disabled button +{% endexample %} + + +## Block buttons + +Make any button assume the full-width of it’s parent. + +{% example html %} +

+

+

+{% endexample %} + + +## Button groups + +Group buttons by wrapping them in a `.ButtonGroup`. + +{% example html %} +
+ + + +
+ +
+ + + +
+{% endexample %} + +{% example html %} +
+ + +
+ + +{% endexample %} + + +## Different fonts + +Buttons can be set using different fonts, if required. + +{% example html %} + + + +{% endexample %} + + +## Multiple labels + +Buttons can have multiple labels. Secondary labels can be useful to lead into primary labels when the button represents a major action. + +{% example html %} + + + +{% endexample %} diff --git a/docs/components/navbar.md b/docs/components/navbar.md new file mode 100644 index 0000000000..e2920a1893 --- /dev/null +++ b/docs/components/navbar.md @@ -0,0 +1,22 @@ +--- +layout: page +title: NavBar +--- + +* Will be replaced with the ToC, excluding the "Contents" header +{:toc} + + +## Desktop NavBar + +The simplest version of the NavBar + +{% example html %} + +{% endexample %} diff --git a/docs/components/segmented-control.md b/docs/components/segmented-control.md new file mode 100644 index 0000000000..bd4e6ebc7a --- /dev/null +++ b/docs/components/segmented-control.md @@ -0,0 +1,41 @@ +--- +layout: page +title: Segmented Control +--- + +A segmented control is a horizontal control made of multiple segments, each segment functioning as a discrete button. Segment text gets truncated when too long to fit into the width of the segment. + +## Default +Contrasts evenly with other form elements + +{% example html %} +
+ + + +
+{% endexample %} + + +## Low-contrast variant +To be used when the control is disabled + +{% example html %} +
+ + + +
+{% endexample %} + + +## High-contrast variant +To be used against a base colour background (like the NavBar) + +{% example html %} +
+ + + +
+{% endexample %} diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 0000000000..6fc38a6b95 --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,46 @@ +--- +layout: simple +title: FAQ +--- + +Frequently asked questions about Origin. + +{:toc} + +## What’s the difference between CSS utilities and components? + +Utilities do one thing and one thing only. One property, one value. Components comprise of multiple properties and perform a specific interactive function for the user. + +Note that utilities can do one thing and one thing only, _no matter what_. There are two ways to do so. The first is to use `!important` within a mixin, like so: + +{% highlight scss %} +@include font-family(default, !important); +{% endhighlight %} + +The second is to use utility _classes_ in HTML, like so: + +{% highlight html %} +

+ Charlie Murphy +

+{% endhighlight %} + + These classes can be generated in your output CSS file by setting one or more variables in [`_utility-settings.scss`](https://github.com/fac/origin/blob/master/assets/scss/local/utilities/_utility-settings.scss) to `true`. **Setting these to `true` will add weight to your output CSS, so be careful.** Utility classes should only ever generally be used as exceptions; components should always know about their modifiers and states. + + +## Why the weird syntax? + +Clarity. When looking at markup, the difference between a component, a layout component, and a utility is clear. + +* `ComponentNames` are clearly identified by their upper camel case syntax +* `l-LayoutComponents` have a specific namesspacing to signal that they’re for layout only +* `u-utility-classes` follow the syntax conventions of regular CSS, as that’s what they manipulate + +See [naming conventions]({{ site.baseurl }}/guidance/naming-conventions) for more details. + + +## When should I create components? + +Generally: as soon as possible. It’s never too early to think about creating a component, as doing so is the best way to check whether there’s already an existing component that does some (or all) of what’s needed. + +Part of the point of the differing syntax (see above) is to help you decide what kind of component you’re building. diff --git a/docs/forms.md b/docs/forms.md deleted file mode 100644 index 5160a300fb..0000000000 --- a/docs/forms.md +++ /dev/null @@ -1,255 +0,0 @@ ---- -layout: page -title: Forms ---- - -Style individual form controls and utilize common layouts. - -
- Heads up! Forms need some reworking to clean up the specificity and required markup. We'll get to that soon! -
- -## Contents - -* Will be replaced with the ToC, excluding the "Contents" header -{:toc} - -## Overview - -- We reset several elements' default styles for cross browser consistency and easier manipulation later. This includes `
`s, WebKit validation bubbles, and most textual ``s. -- Specific types of textual ``s are styled automatically, but `.form-control` is available should you need it. -- Always declare a `type` on your ` - -{% endexample %} - -## Form contrast - -Textual form controls have a white background by default. You can change this to a light gray with `.input-contrast`. - -{% example html %} -
- - -
-{% endexample %} - -## Sizing - -Make inputs smaller, larger, or full-width with an additional class. - -### Mini - -{% example html %} -
- -
-{% endexample %} - -### Large - -{% example html %} -
- -
-{% endexample %} - -### Block - -{% example html %} -
- -
-{% endexample %} - -## Selects - -Primer adds light `height` and `vertical-align` styles to ` - - - - - - - - - -{% endexample %} - -### Custom - -Custom ` - - - - - - - - - -{% endexample %} - -### Small - -Use the `.select-sm` class to resize both default and custom ` - - - - - - - - - - -{% endexample %} - -## Form groups - -{% example html %} -
-
-
-
-
- -
-
-
- -
-
-
-{% endexample %} - -## Form group validation - -Convey errors and warnings for form groups. Add the appropriate class—either `.errored` or `.warn`—to the `
` to start. Then, house your error messaging in an additional `
` with either `.error` or `.warning`. - -{% example html %} -
-
-
-
-
This example input has an error.
-
-
-
-
-
-
This example input has a warning.
-
-
-{% endexample %} - -## Checkboxes and radios - -Utilities to spice up the alignment and styling of checkbox and radio controls. - -{% example html %} -
-
- -

- This will do insanely awesome and amazing things! -

-
-
-{% endexample %} - -You may also add emphasis to the label: - -{% example html %} -
-
- -
-
-{% endexample %} - -## Input group - -Attached an input and button to one another. - -{% example html %} -
-
- - - - -
-
-{% endexample %} - -## Form actions - -Align buttons to the right—via `float: right` on the buttons—in forms with `.form-actions`. The floats are automatically cleared for you. - -{% example html %} -
- - -
-{% endexample %} diff --git a/docs/guidance/base-styles.md b/docs/guidance/base-styles.md new file mode 100644 index 0000000000..f328978881 --- /dev/null +++ b/docs/guidance/base-styles.md @@ -0,0 +1,27 @@ +--- +layout: page +title: Base styles +--- + +These are the base rules upon which everything in Origin is built. + +## HTML5 doctype + +Origin makes use of certain HTML elements and CSS properties that **require** the use of the HTML5 doctype. Include it at the beginning of all your views/pages. + +{% highlight html %} + + + ... + +{% endhighlight %} + +## Box-sizing + +We reset `box-sizing` to `border-box` for every element in Origin. This allows us to more easily assign widths to elements that also have `padding` and `border`s. + +## Built on Normalize + +For improved cross-browser rendering, we use [Normalize.css](http://necolas.github.io/normalize.css/) to correct small inconsistencies across browsers and devices. + +[**View the source `_base.scss` for more information**](https://github.com/fac/origin/blob/master/assets/scss/local/base/_base.scss) diff --git a/docs/guidance/code-style.md b/docs/guidance/code-style.md new file mode 100644 index 0000000000..ed5655d406 --- /dev/null +++ b/docs/guidance/code-style.md @@ -0,0 +1,287 @@ +--- +layout: page +title: Code style +--- + +* Will be replaced with the ToC, excluding the "Contents" header +{:toc} + +## Whitespace +* Use soft-tabs with a two space indent. +* Keep lines equal to or fewer than 115 characters. *(Width of GitHub diff view without wrapping.)* +* Never leave trailing whitespace. +* End each file with a blank newline. + +## CSS + +### CSS formatting +* Always put each CSS selector on a separate line. +* Leave one blank line between every CSS comment and rule set. +* Leave one space between your CSS selector and opening curly brace. +* Write one CSS declaration per-line. +* Leave one space between your CSS property and value. +* Place the closing rule set curly brace on a separate line, in the same column as the selector. +* Leave one space between each CSS combinator character and your selectors. +* Use a semi-colon after every CSS declaration, even the last one in a rule set. +* Include a space after each comma in comma-separated property or function values. +* Don’t nest declarations more than one-level deep. + +### CSS writing style +* Use lowercase and shorthand hex values (e.g. `#aaa`). +* Use single or double quotes consistently. Preference is for double quotes (e.g. `content: “”`). +* Quote attribute values in selectors (e.g. `input[type="checkbox”]`). +* Avoid ID selectors whenever possible. +* Avoid using element types as part of selectors (e.g. `.button` instead of `a.button`). + +Example: + +{% highlight scss %} +/** + * Comment for the rule set below + */ + +.selector-1, +.selector-2, +.selector-3[type="text"] { + display: block; + float: left; + @include line-height(tight); + @include text-color(fa-blue); +} + +/** + * Another comment + */ + +p + p, +h3 > p { + @include fa-margin-bottom(large); +} +{% endhighlight %} + +#### CSS declaration order +List all ‘vanilla’ CSS declarations alphabetically, and always `@include` rules afterwards, but still in alphabetical order with other `@include` rules. + +Example: + +{% highlight scss %} +.MyComponent { + display: inline-block; + opacity: 0.5; + @include background-color(gray-13); + @include fa-font-family(default); + @include font-size(large); + @include line-height(tight); + @include text-color(fa-blue); +} +{% endhighlight %} + +#### Exceptions and deviations +Large blocks of single declarations can use a slightly different, single-line format. In this case, a space should be included after the opening brace and before the closing brace. + +Example: + +{% highlight scss %} +.selector-1 { width: 10%; } +.selector-2 { width: 20%; } +.selector-3 { width: 30%; } +{% endhighlight %} + +Long, comma-separated property values—such as collections of gradients or shadows—can be arranged across multiple lines in an effort to improve readability and produce more useful diffs. + +Example: + +{% highlight scss %} +@mixin multiple-background-thing { + background: + repeat-x top left / 100% 1px image-url("hairline-horizontal.png"), + repeat-x bottom left / 100% 1px image-url("hairline-horizontal.png"); +} +{% endhighlight %} + +### CSS comments +Every CSS rule set should have a comment stating what it does, why it exists and why it’s been implemented the way it has. Don’t leave others guessing about the decisions you’ve made. + +Comment style should be simple and consistent: + +* Place comments on a new line above their rule set, leave one blank line between every CSS comment and rule set. +* Keep lines equal to or fewer than 115 characters. +* Make liberal use of comments to break CSS code into discrete sections. +* Use "sentence case" comments and consistent text indentation. +* Always reference components and utilities _exactly_ by name: `DropdownMenu-header`, not "header" +* When extra clarity is required, use numeric end-of-line comments to reference documentation for individual declarations. +* When referencing another component, utility class or other class in a comment, always format the class name exactly as it’s written elsewhere. + +Example: + +{% highlight scss %} +/** + * Short description using Doxygen-style comment format + * + * The first sentence of the long description starts here and continues on this + * line for a while finally concluding here at the end of this paragraph. + * + * The long description is ideal for more detailed explanations and + * documentation. It can include example HTML, URLs, or any other information + * that is deemed necessary or useful. + * + * TODO: This is a todo statement that describes an atomic task to be completed + * at a later date. It wraps after 80 characters and following lines are + * indented by 2 spaces. + * + * @tag This is a tag named 'tag' + * + * 1. A helpful description of a declaration's purpose. + * 2. Another declaration or collection of declarations can reference this + * comment with an inline comment corresponding to the lists number. + */ + +/* Thematic section comment block + ========================================================================== */ + +/* Basic comment */ +{% endhighlight %} + +When using thematic blocks in CSS comments, there can be variance of spacing — use 2 spaces between thematic blocks if majority of declarations use one-line comments. + +### CSS practical example +An example of various conventions. + +{% highlight scss %} +/** + * Segmented control + * + * A segmented control is a horizontal control made of multiple segments, each + * segment functioning as a discrete button. Segment text get truncated when + * too long to fit into the width of the segment. + * + * There are three variants of SegmentedControl: + * — Low contrast variant: your default choice; contrasts well with other form elements + * — Base colour variant: use within a view when it really needs to stick out + * — High contrast version: to be used against a base colour background (like the NavBar) + */ + +.SegmentedControl { + border: 1px solid $color--gray-9; + height: $segmented-control-height; + margin: 0; + padding: 0; + text-align: center; + @include fa-border-radius(default); + @include line-height(tight); + @include flexbox(flex); + @include flex-align-items(stretch); + @include flex-direction(row); + @include flex-justify-content(center); +} + +/** + * Individual segment buttons + */ + +.SegmentedControl-segment { + background: none; + border-color: $color--gray-9; + border-style: solid; + border-width: 0 1px 0 0; + display: inline-block; + margin: 0; + padding: 0 4px 1px 4px; + @include flex(1); + @include text-truncate; + @include text-color(gray-9); +} + +/* High contrast variant + ========================================================================== */ + +/** + * A higher contrast variant of the SegmentedControl, to be used primarily on + * the base colour background + */ + +.SegmentedControl--contrastHigh { + border-color: darken($color--base, 10%); +} + +.SegmentedControl--contrastHigh .SegmentedControl-segment { + color: darken($color--base, 10%); + border-color: darken($color--base, 10%); +} +{% endhighlight %} + +## HTML + +### HTML formatting +* Always use lowercase tag and attribute names. +* Write one discrete, block-level element per line. +* Use one additional level of indentation for each nested block-level element. +* Use valueless boolean attributes (e.g. `checked` rather than `checked="checked"`). +* Always use double quotes to quote attribute values. +* Omit the `type` attributes from `link` stylesheet, `style` and `script` elements. +* Always include closing tags. + +Example (uses JSX syntax): + +{% highlight html %} +
+
+ +
+
+{% endhighlight %} + +#### HTML class and attribute order +Component classes (including their `--modifierName` classes) should always be listed first, in alphabetical order. `u-UtilityName` classes should be listed last, except when temporary `is-stateOfComponent` are being applied, in which case they should be listed last. + +HTML attributes should be listed in alphabetical order. + +Example (uses JSX syntax): + +{% highlight html %} +
+{% endhighlight %} + +### HTML practical example +An example of various conventions (uses JSX syntax): + +{% highlight html %} + + + + FreeAgent Mobile App + + + + + + <%= stylesheet_link_tag 'fieldagent', media: 'all'%> + <%= javascript_include_tag 'fieldagent' %> + + + +
+ +
+

{selectedFilterName}

+ +
+
+ + { this.filterOptions() } + + +
+ +
    + + {list} + +
+ +
+ + +{% endhighlight %} + +This documentation and the conventions in it are based on [SUITCSS HTML/CSS code style](https://github.com/suitcss/suit/blob/master/doc/STYLE.md). Many thanks to [Nicolas Gallagher](https://github.com/necolas). diff --git a/docs/guidance/components.md b/docs/guidance/components.md new file mode 100644 index 0000000000..0a5a33782c --- /dev/null +++ b/docs/guidance/components.md @@ -0,0 +1,151 @@ +--- +layout: page +title: Components +--- + +Components are self-contained collections of HTML, CSS, and often JS, that perform a specific function. Buttons, dialogs, tables, navbars, and dropdown menus are all examples of components. + +Each component should have a dedicated CSS file, and live in a distinct `/components` directory. + +Each component should implement a single part of the UI. Don't try to do +too much. In addition to core styles, components often have variants; modified states for specific contexts. + +Most components should not set their own width, margin, and positioning. By authoring a component to be full-width or inline, it can better adapt to the dimensions of an ancestral context. + +## Component scope + +The component's core class name (e.g., `ComponentName`) reserves a namespace +that can only be used by that component. + +All selectors in a component file must start with the component's +namespace. For example, a component called `MyComponent` could have the +following CSS, where every selector starts with the string `MyComponent`. + +{% highlight scss %} +.MyComponent {} +.MyComponent--large {} +.MyComponent-title {} +.MyComponent-image {} +.MyComponent-text {} +.MyComponent-time {} +{% endhighlight %} + +Each class provides a hook to style specific elements within the HTML definition. + +{% highlight html %} +
+

+ +

+ +

+
+{% endhighlight %} + + +## Documenting implementation details + +Components must document their implementation. The CSS comments for a component +should seek to answer the following questions: + +* What is the intended presentation? +* What are the modifiers and states? +* What are the reasons for specific, opaque property values. +* What are the known limitations? + +[How to write your CSS comments]({{ site.baseurl }}/guidance/code-style/#css-comments) + +## Naming components +Syntax: + +{% highlight bash %} +[--modifierName|-descendentName] +{% endhighlight %} + +Component names should be in upper camel case. In addition to no other elements of our HTML & CSS using upper camel case, there are several benefits: + +* It helps to distinguish between the classes for the root of the component, descendent elements, and modifications +* It keeps the specificity of selectors low +* It helps to decouple presentation semantics from document semantics + + +#### ComponentName + +{% highlight scss %} +.MyComponent +.TableView +.DropdownMenu +.Button +.Card +{% endhighlight %} + +{% highlight html %} +
+ … +
+{% endhighlight %} + + +#### ComponentName--modifierName + +A component modifier is a class that modifies the presentation of the base component in some form (for a certain configuration of the component) + +* Write modifier names in lower camel case +* Separate modifiers from the component name by two hyphens +* Include modifiers _in addition_ to the base component class + +{% highlight scss %} +/* Core `SegmentedControl` styles */ + +.SegmentedControl {} + +/* High-contrast `SegementedControl` styles */ + +.SegmentedControl--contrastHigh {} +{% endhighlight %} + +{% highlight html %} +
+{% endhighlight %} + + +#### ComponentName-descendentName + +A component descendent is a class that is attached to a descendent (child) node of a component. It's responsible for applying presentation directly to the descendent on behalf of a particular component. Write descendent names in lower camel case. + +{% highlight html %} +
    +
  1. +

    +

    +
  2. +
+{% endhighlight %} + +#### ComponentName.is-stateOfComponent + +Use `is-stateName` to reflect changes to a component's state. The state name must be lower camel case. **Never style these classes directly; they should always be used as an adjoining class.** + +This means that the same state names can be used in multiple contexts, but every component must define its own styles for the state (as they are scoped to the component). + +Don't use `is-stateName` classes when you should be using a `ComponentName--modifierName` class. `is-stateName` classes should only be used for **temporary** states (e.g. don't use `is-flash` to create a flash notice when it should actually be `Notice--flash`). + +{% highlight scss %} +.DropdownMenu {} +.DropdownMenu.is-expanded {} +{% endhighlight %} + +{% highlight html %} + +{% endhighlight %} + +### Styling dependencies + +**A component should not know about the implementation of its dependencies**. +The appearance of dependencies must be configured using the interface they provide. + +Controlling dimensions, margins, position, and inheritable styles of a +component can be done _indirectly_. Add a class to its root element, or wrap +it in another element. diff --git a/docs/guidance/naming-conventions.md b/docs/guidance/naming-conventions.md new file mode 100644 index 0000000000..043eb2f393 --- /dev/null +++ b/docs/guidance/naming-conventions.md @@ -0,0 +1,38 @@ +--- +layout: page +title: Naming conventions +--- + +## Components + +{% highlight scss %} +.ComponentName {} +{% endhighlight %} + +Upper camel case syntax because they’re the heroes of the show. + + +## Layout components + +{% highlight scss %} +.l-ComponentName {} +{% endhighlight %} + +Given a specific `l-` namespacing to differentiate them from normal components. + + +## Utilities + +{% highlight scss %} +@include background-color {} +{% endhighlight %} + +Follows regular CSS syntax, as that’s all the simple property/value nature of utilities are manipulating. + + +## Variables +Match the naming convention of utilities or components when creating global variables: + +{% highlight css %} +$padding--action: $spacing--5; +{% endhighlight %} diff --git a/docs/guidance/principles.md b/docs/guidance/principles.md new file mode 100644 index 0000000000..a9ee9bdf51 --- /dev/null +++ b/docs/guidance/principles.md @@ -0,0 +1,61 @@ +--- +layout: page +title: Principles +--- + +We write HTML & CSS using a component-based methodology. It massively improves the authoring experience, ease of maintenance and code quality. + +This method is different to “traditional” standards-compliant HTML & CSS in that our semantics are _not_ typically content-derived. Instead we overrule the inherited styles of global HTML elements (`h1`, `p`, `li` etc) and derive class names from our design patterns and functionality. Doing so means we can: + +* Create highly reusable [utilities]({{ site.baseurl }}/guidance/utilities/) and [components]({{ site.baseurl }}/guidance/components/), named in ways that communicate useful information to developers +* Add semantic value for machines using global HTML elements without worrying how they affect about presentation + +We also use attributes like `data-ui-component` to add extra semantic value. + +### Further reading +* [About HTML semantics and front-end architecture](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/) +* [Block Element Modifier method](http://bem.info/method/) +* [MindBEMding – getting your head ’round BEM syntax](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/) +* [Object Oriented CSS](https://github.com/stubbornella/oocss/wiki) +* [Scalable Modular Architecture CSS](http://smacss.com/book/) + +## Principles + +_Reproduced from [SUIT CSS design principles](https://github.com/suitcss/suit/blob/master/doc/design-principles.md)_ + +1. [Modularity](#modularity) +2. [Cohesion](#cohesion) +3. [Composition and configuration](#composition) +4. [Loose coupling](#coupling) +5. [Soft encapsulation](#encapsulation) +6. [Documentation](#documentation) + +### Modularity + +Each component should have a single focus and contain everything necessary to realise a specific part of the UI. Components may contain HTML, CSS, JavaScript, and associated assets without making assumptions about the outer rendering context. + +### Cohesion + +The functionality and presentation defined by a component must be semantically related. Components do not have direct influence over each other. + +### Composable and configurable + +Composability is concerned with the inter-relationships of components. Composable systems have components that can be assembled in various combinations, as required. + +Configuration is done via interfaces that are provided and used by components. + +### Loose coupling + +Components should not directly modify the presentation or behaviour of their dependencies. Relying on interfaces and events for inter-component communication results in a loose coupling. + +Attempting to reuse too much code across components can increase their coupling. Isolation is more important than avoiding the repetition of superficially similar code. + +### Soft encapsulation + +The implementation of a component should not be exposed to other components. For example: your component should not leak styles into the HTML tree fragments of other components; a component's HTML should not be directly included in the HTML for another component. + +Complexity is a significant problem for large, adaptive applications. The more you can reduce the entanglement of your components, the easier it is to reason about the system. + +### Documentation + +Write small, independent components that are well documented to describe how the components should be used, and why specific CSS properties are needed in the implementation. Do not assume that CSS is self-documenting. diff --git a/docs/guidance/utilities.md b/docs/guidance/utilities.md new file mode 100644 index 0000000000..cd7386f0c9 --- /dev/null +++ b/docs/guidance/utilities.md @@ -0,0 +1,119 @@ +--- +layout: page +title: Utilities +--- + +Our CSS utilities define all of our global CSS values and provide universal methods of declaring them. They’re managed in the [fa-css-utilities](https://github.com/fac/fa-css-utilities) repo and made available to projects via NPM and Bower. + + +## Key files + +**[`_utility-values.scss`](https://github.com/fac/fa-css-utilities/blob/master/_utility-values.scss)** +Where we define all of our raw CSS values and assign them to variables. + +**[`_utility-aliases.scss`](https://github.com/fac/fa-css-utilities/blob/master/_utility-aliases.scss)** +Where we map aliases to our variables. Doing so lets us reference those aliases in mixins, and lets us optionally generate utility classes in the output CSS. + +**[`_project-aliases.scss`](https://github.com/fac/fa-css-utilities/blob/master/_project-aliases.scss)** +Where project-specific aliases are defined. Doing so means we aren’t continually declaring things like `@include line-height(x-loose)` when `x-loose` is actually the default `line-height` for a particular project. In this file we can just assign `x-loose` to `default` for that project only. + +**[`_utility-settings.scss`](https://github.com/fac/fa-origin/blob/master/assets/scss/_utility-settings.scss)** +Where we define whether or not to render utility classes in the output CSS. This file is cloned and customised for each project. + + +## Examples + +Where we might have previously written: +{% highlight scss %} +color: #333; +font-family: "Source Sans Pro", "Helvetica Neue", Arial, Helvetica, sans-serif; +font-size: 1rem; +line-height: 140%; +{% endhighlight %} + +We now write: +{% highlight scss %} +@include font-family(default); +@include font-size(default); +@include line-height(default); +@include text-color(default); +{% endhighlight %} + +Components might look like: + +{% highlight scss %} +.MyComponent { + @include background-color(gray-13); + @include border(thin, gray-11); + @include font-family(default); + @include font-size(large); + @include line-height(tight); + @include text-color(fa-blue); +} + +.MyOtherComponent { + @include flexbox(flex); + @include flex-direction(row-reverse); + @include flex-justify-content(center); + @include flex-grow(2); + @include flex-shrink(0); + @include margin-top(large); +} +{% endhighlight %} + +`!important` can optionally be added to any mixin declaration: + +{% highlight scss %} +@include padding(large, !important); +{% endhighlight %} + +This is especially useful for refactoring; `!important` allows us a way to turn existing UI patterns that rely on the cascade into completely self-contained components — _without_ breaking lots of stuff. Once a component has been created and rolled out, any `!important` arguments can just be removed. + + + +## Benefits + +Utilities create a simpler, faster, and more meaningful way to write CSS. Mixins are referenced instead of writing regular property/value declarations. They provide: + +* **Universal scales and aliases** for: `font-size`, `font-family`, `line-height`, `color`, and much more. +* **Library of colours** for text and block-level elements. +* **Mixins and utility classes** for 40+ CSS properties. + +This functionality provides a range of benefits: + +* Technical debt and stylistic deviations are avoided because every declaration always maps back to a pre-defined value. +* Finding things like the right `font-size` or `line-height` is quicker and easier because their values exists in scales. Want a slightly bigger size? Increase the number by one. +* “Human friendly” aliases like `x-small` and `xx-large` communicate styles more effectively to developers +* Switching between different projects and codebases is easier because there’s a universal way of writing CSS across all of them +* Mixins allow us to bake in any vendor prefixing, so they don’t have to be typed manually. + + + +## Utility classes + +Utility classes can be generated in your output CSS so they can be applied directly to HTML elements. They will produce the same effect as using the utility mixins, with one very important difference: **utility classes all have `!important` set**. This is deliberate; utility classes should _do one thing no matter what_. + +Utility classes should be used sparingly. They’re useful for quickly prototyping ideas or hacking together a quick modification of a component before deciding whether to actually make that modification _part_ of the component. But always aim to use utility mixins; doing so encourages the idea of building self-contained components. Components should define and control their own states and variations. + +### How to generate utility classes +Set a utility to `true` in your project’s [`_utility-settings.scss`](https://github.com/fac/fa-origin/blob/master/assets/scss/_utility-settings.scss) and the associated utility classes will appear in your output CSS file. Naturally these will add weight to your file, so keep an eye on the file size. + +### Example + +You might start with this: + +{% highlight html %} +
+ + +
+{% endhighlight %} + +But you should end up with: + +{% highlight html %} +
+ + +
+{% endhighlight %} diff --git a/docs/guidelines.md b/docs/guidelines.md deleted file mode 100644 index 00d659bb35..0000000000 --- a/docs/guidelines.md +++ /dev/null @@ -1,233 +0,0 @@ ---- -layout: page -title: Guidelines ---- - -Best practices and guidelines for writing HTML and CSS with approachable formatting, syntax, and more. - -## Contents - -* Will be replaced with the ToC, excluding the "Contents" header -{:toc} - -## HTML - -### General formatting - -* Use soft-tabs with a two space indent. Spaces are the only way to guarantee code renders the same in any person's environment. -* Paragraphs of text should always be placed in a `

` tag. Never use multiple `
` tags. -* Items in list form should always be in `

    `, `
      `, or `
      `. Never use a set of `
      ` or `

      `. -* Every form input that has text attached should utilize a `


      `, ``, and ``. -* Don't set `tabindex` manually—rely on the browser to set the order. - -{% highlight html %} -

      - This is my paragraph of special text. -

      -{% endhighlight %} - -### Boolean attributes - -Many attributes don't require a value to be set, like `disabled` or `checked`, so don't set them. - -{% highlight html %} - - - - - -{% endhighlight %} - -For more information, [read the WhatWG section](http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#boolean-attributes). - -### Lean markup - -Whenever possible, avoid superfluous parent elements when writing HTML. Many times this requires iteration and refactoring, but produces less HTML. For example: - -{% highlight html %} - - - - - - - -{% endhighlight %} - -### Forms - -* Lean towards radio or checkbox lists instead of select menus. -* Wrap radio and checkbox inputs and their text in `