Skip to content

Commit 2dc5b16

Browse files
committed
final changes for version 1
1 parent 9e08cef commit 2dc5b16

13 files changed

Lines changed: 558 additions & 224 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Folders and files
22
node_modules/
3-
dist/
3+
lib/
44
npm-debug.log
55
yarn-error.log
66

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"printWidth": 80,
3+
"proseWrap": "never",
34
"singleQuote": true,
45
"trailingComma": "es5"
56
}

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Changes to backpack.css 🎒
22

3-
## 1.0.0 (?? ??, 2018)
3+
## 1.0.0 (October 2, 2018)
4+
5+
- Version 1! 😃

README.md

Lines changed: 69 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# backpack.css 🎒 <!-- omit in toc -->
22

3-
A lightweight and somewhat opinionated CSS foundation that is best suited to
4-
applications.
3+
A lightweight and somewhat opinionated CSS foundation that is best suited to applications.
54

65
## Table of contents <!-- omit in toc -->
76

@@ -14,6 +13,10 @@ applications.
1413
- [What it does](#what-it-does)
1514
- [Evolution](#evolution)
1615
- [Browser support](#browser-support)
16+
- [Publishing](#publishing)
17+
- [The breakdown of step 3](#the-breakdown-of-step-3)
18+
- [Contributing](#contributing)
19+
- [Versioning](#versioning)
1720

1821
## Installation
1922

@@ -29,51 +32,41 @@ If you prefer [Yarn](https://yarnpkg.com/en/), use this command instead:
2932
yarn add backpack.css --dev
3033
```
3134

32-
CDN version coming soon, see: https://github.com/chris-pearce/backpack.css/issues/15.
35+
CDN version coming soon, [see](https://github.com/chris-pearce/backpack.css/issues/15).
3336

3437
## How to use
3538

36-
Typically you'll be wanting to import all of backpack.css styles into your
37-
project but you do have the choice to be selective.
38-
39-
The one strict rule backpack.css does have is that it must come before your
40-
project's CSS to ensure correct ordering of your styles and to be able to
41-
override any of backpack.css styles.
39+
Typically you'll be wanting to import all of backpack.css styles into your project but you do have the choice to be selective. The one strict rule is that it must come before your project's CSS to ensure correct ordering of your styles and to be able to override any of backpack.css styles.
4240

4341
### Importing with a bundler
4442

45-
If you're using a bundler such as [webpack](https://webpack.js.org/) and wanting
46-
to import all of backpack.css then your app's entry point should look like this:
43+
If you're using a bundler such as [webpack](https://webpack.js.org/) and wanting to import all of backpack.css then your projects entry point should look like this:
4744

4845
```js
4946
import 'backpack.css';
50-
import '[path-to-your-project-css]';
47+
import '[path(s)-to-your-project-css]';
5148
```
5249

5350
If you want to be selective then simply `import` the backpack.css files you need, for example:
5451

5552
```js
56-
import 'backpack.css/resets.css';
57-
import 'backpack.css/content-sectioning.css';
58-
import 'backpack.css/forms.css';
59-
import '[path-to-your-project-css]';
53+
import 'backpack.css/lib/resets.css';
54+
import 'backpack.css/lib/content-sectioning.css';
55+
import 'backpack.css/lib/forms.css';
56+
import '[path(s)-to-your-project-css]';
6057
```
6158

62-
The order at which you import each module is important, to see this order and
63-
what `.css` files are available refer to backpack.css [`index.css`](src/index.css).
59+
The order at which you import each module is important, to see this order and what `.css` files are available refer to backpack.css [`index.css`](src/index.css).
6460

6561
### Importing without a bundler
6662

67-
CDN version coming soon, see:
68-
https://github.com/chris-pearce/backpack.css/issues/15.
63+
CDN version coming soon, [see](https://github.com/chris-pearce/backpack.css/issues/15). In the meantime you can link to the hosted version on [UNPKG](https://unpkg.com) via a `<link>` element in your HTML Head, however, make sure it comes before your project's CSS.
6964

7065
### Overriding
7166

72-
backpack.css is just CSS so you can easily override any of backpack.css styles
73-
just as you would override any CSS, as in, via the rules of the cascade and
74-
specificity.
67+
backpack.css is just CSS so you can easily override any of backpack.css styles just as you would override any CSS, as in, via the rules of the cascade and specificity.
7568

76-
For example, if you didn't want to use `system-ui` as the global `font-family` set in `main-root.css` then simply redeclare it in your project CSS like so:
69+
For example, if you don't want to use `system-ui` as the global `font-family` set in [`main-root.css`](src/main-root.css) then simply redeclare it in your project CSS like so:
7770

7871
```css
7972
html {
@@ -83,33 +76,69 @@ html {
8376

8477
## Motivation
8578

86-
Nowadays I'm building [React](https://reactjs.org/) applications that have
87-
highly componentised User Interfaces (UI) making use of native CSS layout
88-
mechanisms such as [Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) and
89-
[Grid](https://css-tricks.com/snippets/css/complete-guide-grid/). I'm no longer finding the need for heavy handed CSS frameworks that handle most of my UI
90-
concerns, especially layout. Instead I build components with a smidgen of global
91-
styles.
79+
Nowadays I'm building [React](https://reactjs.org/) applications that have highly componentised User Interfaces (UI) making use of native CSS layout mechanisms such as [Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) and [Grid](https://css-tricks.com/snippets/css/complete-guide-grid/). I'm no longer finding the need for heavy handed CSS frameworks that handle most of my UI concerns, especially layout. Instead I build components with a smidgen of global styles.
9280

93-
What I do need, however, are a bunch of smart and sensible foundational styles
94-
suited for applications that I would typically forget project to project—think
95-
[Normalize.css](http://necolas.github.io/normalize.css/) and then some.
96-
Something that is lightweight, super easy to intergrate, and can easily be
97-
overriden or allow for modular use, thus giving birth to backpack.css 🙂.
81+
What I do need, however, are a bunch of smart and sensible foundational styles suited for applications that I would typically forget project to project—think [Normalize.css](http://necolas.github.io/normalize.css/) and then some. Something that is lightweight, super easy to intergrate, and can easily be overriden or allow for modular use, thus giving birth to backpack.css 🙂.
9882

9983
## What it does
10084

101-
_Coming soon…_
85+
- Removes margins, paddings, and borders from all elements except `<input>` so that everything is on an even playing field.
86+
- Applies sensible form element resets and normalisations, e.g.: _remove all user-agent styles from buttons_.
87+
- Makes all images responsive.
88+
- Applies sensible interactive styles, e.g.: _avoid 300ms click delay on touch devices_.
89+
- Applies foundational print styles.
90+
- Applies the nicer `border-box` value to all elements.
91+
- Removes list bullets.
92+
- Applies sensible OpenType features, e.g.: _enables lining numerals, tabular numerals, and slashed zero, for table content_.
93+
94+
_And more…_
10295

10396
## Evolution
10497

105-
This is the third CSS framework/library I've created. Looking at each one
106-
lets you see how UI development has evolved over the years with each iteration
107-
getting smaller and smaller.
98+
This is the third CSS framework/library I've created. Looking at each one lets you see how UI development has evolved over the years with each iteration getting smaller and smaller.
10899

109100
1. [Scally](https://github.com/chris-pearce/scally) _circa 2014_
110101
2. [Shell](https://github.com/campaignmonitor/shell) _circa 2016_
111102
3. [backpack.css](https://github.com/chris-pearce/backpack.css) _circa 2018_
112103

113104
## Browser support
114105

115-
_Coming soon…_
106+
- Chrome
107+
- Edge
108+
- Firefox
109+
- Internet Explorer 11
110+
- Safari 8+
111+
- Opera
112+
113+
Not everything will work in Internet Explorer 11, e.g.: the [`system-ui`](https://caniuse.com/#feat=font-family-system-uiZ) font, however, anything that doesn't work will simply degrade gracefully.
114+
115+
It's recommended to have [Autoprefixer](https://github.com/postcss/autoprefixer) setup as part of your projects build.
116+
117+
## Publishing
118+
119+
Once new changes have been merged do the following:
120+
121+
1. Add all new changes to [`CHANGELOG.md`](CHANGELOG.md) making sure to follow the existing format.
122+
2. Update the version number in [`index.css`](src/index.css).
123+
3. Run: `npm version <update_type>` where `<update_type>` is one of the semantic versioning release types: **patch**, **minor**, or **major** (see [versioning](#versioning)).
124+
125+
## The breakdown of step 3
126+
127+
1. Run the `build` script.
128+
2. Add `CHANGELOG.md` and `index.css` modified in **steps 1** and **2** to the version commit.
129+
3. Change the version number in [`package.json`](package.json).
130+
4. Push the new version commit and tag up to the repository.
131+
5. Clean the `lib` directory.
132+
6. Publish the new version to the NPM registry.
133+
134+
_Each step will only run if the one before it passed._
135+
136+
## Contributing
137+
138+
_`CONTRIBUTING.MD` coming soon, [see](https://github.com/chris-pearce/backpack.css/issues/10)._
139+
140+
## Versioning
141+
142+
backpack.css is maintained under the [Semantic Versioning guidelines](http://semver.org/). We'll do our best to adhere to those guidelines and strive to maintain backwards compatibility.
143+
144+
See the [CHANGELOG](CHANGELOG.md).

package.json

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
{
22
"name": "backpack.css",
3-
"main": "backpack.css",
3+
"main": "lib/backpack.css",
44
"version": "0.0.0",
55
"description": "A lightweight and somewhat opinionated CSS foundation that is best suited to applications 🎒.",
6+
"keywords": [
7+
"css",
8+
"css-library",
9+
"css-foundation",
10+
"css-reset",
11+
"css-normalise"
12+
],
13+
"files": [
14+
"lib"
15+
],
616
"scripts": {
7-
"bundle": "postcss src/index.css -u postcss-import --no-map -o dist/backpack.css",
8-
"build": "npm run bundle",
9-
"prebuild": "rimraf dist/"
17+
"bundle": "postcss src/index.css -u postcss-import --no-map -o lib/backpack.css",
18+
"clean": "rimraf lib",
19+
"copy": "cp -r src/* lib && rm lib/index.css",
20+
"build": "yarn bundle && yarn copy",
21+
"prebuild": "yarn clean",
22+
"version": "npm run build && git add .",
23+
"postversion": "git push && git push --tags && yarn clean && npm publish"
1024
},
1125
"repository": "[email protected]:chris-pearce/backpack.css.git",
12-
"author": "Chris Pearce <crite70@gmail.com>",
26+
"author": "Chris Pearce <hello@cjpearce.com>",
1327
"license": "MIT",
14-
"dependencies": {
15-
"normalize.css": "^8.0.0",
16-
"postcss-import": "^11.1.0"
17-
},
1828
"devDependencies": {
19-
"postcss-cli": "^5.0.0",
29+
"normalize.css": "^8.0.0",
30+
"postcss-cli": "^6.0.0",
31+
"postcss-import": "^12.0.0",
32+
"prettier": "^1.14.3",
2033
"rimraf": "^2.6.2"
2134
}
2235
}

src/content-sectioning.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* We scope our heading styles to classes instead of the `<hx>` element selector
33
* so our styles are not tied to their semantics, i.e., if you want a `<h4>` to
44
* look like a `<h2>` you can easily do this. All of the heading elements are
5-
* reset to have the same styles as the base copy. See: https://medium.com/fed-or-dead/handling-headings-in-a-ui-component-library-2587de93c890
5+
* reset to have the same styles as the base copy. See:
6+
* https://medium.com/fed-or-dead/handling-headings-in-a-ui-component-library-2587de93c890
67
*/
78

89
h1,

src/forms.css

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Override normalize.css's opinionated styles, `line-height` is set to
3-
* 'normal' as that's what most user-agents use.
4-
* See: https://github.com/necolas/normalize.css/issues/694.
2+
* Override normalize.css's opinionated styles, `line-height` is set to 'normal'
3+
* as that's what most user-agents use. See:
4+
* https://github.com/necolas/normalize.css/issues/694.
55
*/
66

77
button,
@@ -29,11 +29,10 @@ button {
2929
}
3030

3131
/*
32-
* 1. Remove top inner shadow that iOS applies to all textual inputs.
33-
* ✌︎ Credit
32+
* 1. Remove top inner shadow that iOS applies to all textual inputs. ✌︎ Credit
3433
* https://davidwalsh.name/input-shadows-ipad
3534
* 2. Remove padding (mostly 1px) that most user-agents apply to all textual
36-
inputs.
35+
* inputs.
3736
*/
3837

3938
[type='date'],
@@ -64,8 +63,7 @@ textarea {
6463
* Override a `<fieldset>`s default `min-width: min-content;` with the more
6564
* standard `min-width: 0;` so it renders as a block element would.
6665
*
67-
* ✌︎ Credit
68-
* https://thatemil.com/blog/2015/01/03/reset-your-fieldset.
66+
* ✌︎ Credit https://thatemil.com/blog/2015/01/03/reset-your-fieldset.
6967
*/
7068

7169
fieldset {
@@ -78,8 +76,8 @@ body:not(:-moz-handler-blocked) fieldset {
7876

7977
/**
8078
* Remove the clear field button (an "X" icon) and the reveal password button
81-
* (an "eye" icon) that is generated by IE 10+ for textual inputs.
82-
* See: http://stackoverflow.com/a/21869433/1116204.
79+
* (an "eye" icon) that is generated by IE 10+ for textual inputs. See:
80+
* http://stackoverflow.com/a/21869433/1116204.
8381
*/
8482

8583
::-ms-clear,
@@ -97,9 +95,9 @@ body:not(:-moz-handler-blocked) fieldset {
9795
}
9896

9997
/**
100-
* Fixes a bug in Safari Mobile 7.0+ where click events aren't fired on
101-
* elements that aren't typically interactive.
102-
* See: https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile.
98+
* Fixes a bug in Safari Mobile 7.0+ where click events aren't fired on elements
99+
* that aren't typißcally interactive. See:
100+
* https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile.
103101
*/
104102

105103
[role='button'] {

src/image-and-multimedia.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
*/
88

99
img {
10-
height: auto; /* [1] */
11-
max-width: 100%; /* [2] */
10+
height: auto; /* 1 */
11+
max-width: 100%; /* 2 */
1212
}

src/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* backpack.css v0.0.0
2+
* backpack.css v1.0.0
33
* MIT License
44
* https://github.com/chris-pearce/backpack.css
55
*/
@@ -34,3 +34,4 @@
3434
@import 'table-content.css';
3535
@import 'typography.css';
3636
@import 'interactive.css';
37+
@import 'print.css';

src/main-root.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* 1. Set the font family of the entire document to use the 'system-ui'
3-
* `font-family` value.
2+
* 1. Set the font family of the entire document to use 'system-ui'.
43
* 2. Set the font size of the entire document using the default user-agent size
54
* which is typically 16px.
65
* 3. Increase the line height from normalize.css's small '1.15' value. The

0 commit comments

Comments
 (0)