bitstyles 0.8.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +6 -10
  3. data/.nvmrc +1 -1
  4. data/.stylelintrc +1 -164
  5. data/.travis.yml +19 -0
  6. data/README.md +66 -33
  7. data/bitstyles.gemspec +1 -1
  8. data/lib/bitstyles/version.rb +1 -1
  9. data/package.json +21 -17
  10. data/scss/bitstyles.scss +53 -45
  11. data/scss/bitstyles/base/_all.scss +7 -0
  12. data/scss/bitstyles/base/_figure.scss +1 -1
  13. data/scss/bitstyles/base/_forms.scss +31 -26
  14. data/scss/bitstyles/base/_hr.scss +1 -1
  15. data/scss/bitstyles/base/_images.scss +1 -1
  16. data/scss/bitstyles/base/_link.scss +2 -14
  17. data/scss/bitstyles/base/_media.scss +2 -2
  18. data/scss/bitstyles/base/_typography.scss +37 -89
  19. data/scss/bitstyles/components/_expander.scss +8 -5
  20. data/scss/bitstyles/components/_modal.scss +41 -26
  21. data/scss/bitstyles/generic/_all.scss +2 -0
  22. data/scss/bitstyles/layout/_content.scss +7 -3
  23. data/scss/bitstyles/layout/_grid.scss +46 -23
  24. data/scss/bitstyles/layout/_topbar.scss +19 -4
  25. data/scss/bitstyles/layout/_width.scss +18 -11
  26. data/scss/bitstyles/objects/_absolute-center.scss +8 -2
  27. data/scss/bitstyles/objects/_absolute-cover.scss +11 -2
  28. data/scss/bitstyles/objects/_block.scss +5 -2
  29. data/scss/bitstyles/objects/_bordered-header.scss +8 -3
  30. data/scss/bitstyles/objects/_break-long-words.scss +6 -3
  31. data/scss/bitstyles/objects/_button--icon.scss +8 -4
  32. data/scss/bitstyles/objects/_button.scss +22 -13
  33. data/scss/bitstyles/objects/_clearfix.scss +7 -4
  34. data/scss/bitstyles/objects/_fixed-ratio.scss +24 -9
  35. data/scss/bitstyles/objects/_flex.scss +12 -8
  36. data/scss/bitstyles/objects/_hidden.scss +10 -7
  37. data/scss/bitstyles/objects/_icon.scss +19 -11
  38. data/scss/bitstyles/objects/_input.scss +16 -9
  39. data/scss/bitstyles/objects/_label.scss +2 -2
  40. data/scss/bitstyles/objects/_link.scss +18 -15
  41. data/scss/bitstyles/objects/_list-inline.scss +26 -0
  42. data/scss/bitstyles/objects/_list-reset.scss +5 -3
  43. data/scss/bitstyles/objects/_media.scss +9 -2
  44. data/scss/bitstyles/objects/_object-cover.scss +20 -0
  45. data/scss/bitstyles/objects/_overflow.scss +20 -0
  46. data/scss/bitstyles/objects/_truncate-with-ellipsis.scss +4 -3
  47. data/scss/bitstyles/objects/_typography.scss +8 -62
  48. data/scss/bitstyles/objects/_vertical-center.scss +5 -2
  49. data/scss/bitstyles/objects/_visuallyhidden.scss +10 -6
  50. data/scss/bitstyles/settings/_button.scss +1 -1
  51. data/scss/bitstyles/settings/_content.scss +2 -3
  52. data/scss/bitstyles/settings/_fixed-ratio.scss +3 -0
  53. data/scss/bitstyles/settings/_global.breakpoints.scss +5 -5
  54. data/scss/bitstyles/settings/_global.color-palette.scss +47 -0
  55. data/scss/bitstyles/settings/_global.layout.scss +7 -5
  56. data/scss/bitstyles/settings/_global.typography.scss +25 -17
  57. data/scss/bitstyles/settings/_grid.scss +1 -1
  58. data/scss/bitstyles/settings/_hidden.scss +1 -1
  59. data/scss/bitstyles/settings/_icon.scss +3 -3
  60. data/scss/bitstyles/settings/_input.scss +4 -4
  61. data/scss/bitstyles/settings/_link.scss +4 -0
  62. data/scss/bitstyles/settings/_modal.scss +2 -1
  63. data/scss/bitstyles/settings/_topbar.scss +4 -2
  64. data/scss/bitstyles/settings/_visuallyhidden.scss +1 -1
  65. data/scss/bitstyles/settings/_width.scss +1 -1
  66. data/scss/bitstyles/tools/_absolute-center.scss +8 -3
  67. data/scss/bitstyles/tools/_absolute-cover.scss +8 -2
  68. data/scss/bitstyles/tools/_all.scss +23 -0
  69. data/scss/bitstyles/tools/_block.scss +5 -2
  70. data/scss/bitstyles/tools/_break-long-words.scss +6 -2
  71. data/scss/bitstyles/tools/_clearfix.scss +7 -2
  72. data/scss/bitstyles/tools/_fixed-ratio.scss +41 -4
  73. data/scss/bitstyles/tools/_flex.scss +7 -3
  74. data/scss/bitstyles/tools/_font-face.scss +11 -2
  75. data/scss/bitstyles/tools/_hidden.scss +5 -2
  76. data/scss/bitstyles/tools/_link.scss +25 -0
  77. data/scss/bitstyles/tools/_list-reset.scss +7 -3
  78. data/scss/bitstyles/tools/_media-query.scss +14 -7
  79. data/scss/bitstyles/tools/_media.scss +10 -3
  80. data/scss/bitstyles/tools/_overflow.scss +19 -0
  81. data/scss/bitstyles/tools/_palette.scss +28 -0
  82. data/scss/bitstyles/tools/_spacing.scss +22 -0
  83. data/scss/bitstyles/tools/_truncate-with-ellipsis.scss +7 -3
  84. data/scss/bitstyles/tools/_typography-conversions.scss +20 -7
  85. data/scss/bitstyles/tools/_typography.scss +124 -5
  86. data/scss/bitstyles/tools/_vertical-center.scss +5 -2
  87. data/scss/bitstyles/tools/_visuallyhidden.scss +9 -6
  88. data/scss/bitstyles/tools/_width.scss +10 -1
  89. data/scss/bitstyles/tools/_zindex.scss +34 -14
  90. data/scss/bitstyles/trumps/_background-color.scss +8 -3
  91. data/scss/bitstyles/trumps/_color.scss +8 -3
  92. data/scss/bitstyles/trumps/_margin.scss +5 -5
  93. data/scss/bitstyles/trumps/_no-margin.scss +5 -5
  94. data/scss/bitstyles/trumps/_no-padding.scss +5 -5
  95. data/scss/bitstyles/trumps/_padding.scss +5 -5
  96. data/scss/bitstyles/trumps/_text-align.scss +3 -4
  97. data/scss/bitstyles/trumps/_text-style.scss +4 -2
  98. data/scss/bitstyles/trumps/_text-weight.scss +6 -3
  99. data/yarn.lock +6511 -0
  100. metadata +16 -14
  101. data/build/.gitignore +0 -4
  102. data/scripts/styleguide.sh +0 -16
  103. data/scss/bitstyles/objects/_expander.scss +0 -45
  104. data/scss/bitstyles/settings/_global.color-theme.scss +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a483a85b0d8fb36fc6d843a31ca7b6171bfd670
4
- data.tar.gz: c8ec427baa516f453b152c9f91a343092553d1d6
3
+ metadata.gz: e91b59a2ab0679409414fe97fff3ec8c5b3430ac
4
+ data.tar.gz: 01a24c25ae1c3716c91fcf5366641430210c3110
5
5
  SHA512:
6
- metadata.gz: ea9dd48e5f8928a77069976982c36f7aae008f64b2ea9ef2f0b76eff6874bb1b1eb16a835e91f775c8e4188a318980951d3c8a66b8f44b04473df0579416efa7
7
- data.tar.gz: 00fd08609acaeba3712fae4a241f64db4b76aa4f517f2d78636c692aa49a746926b0f838d8b04ef7c59775d3cdecc99c3931b4a9e13f4c6433c6a34e2eed21e9
6
+ metadata.gz: c7c850dd1ed6ccd389334b87e9df4d5fa8220f26ca50f40123520d90906532a3d3f664104a99fa1926bf0b64fa3f41d7bed9e4d14b762f38caa682be3237b289
7
+ data.tar.gz: fb53c083d94793833b9ab4d1e6667c8d5012cafe7b112d8d1f1025ab941e700c0adba5abbde126153a7ac27d6571850346df404abe880d6b67369b952ed56e8a
@@ -1,20 +1,16 @@
1
- ### Summary
2
-
3
- Fixes # .
1
+ Fixes #
4
2
 
5
3
  The following changes are contained in this pull request:
6
4
  - x
7
5
  - y
8
6
  - z
9
7
 
10
- ### Changes to objects & trumps
8
+ Delete if not applicable:
11
9
 
12
10
  - [ ] Styleguide documentation has been updated.
13
- - [ ] `backstop.json` file has been updated
14
- - [ ] `npm run test:build` script has been sucessfully run and new/changed images committed
15
- - [ ] `npm run stats` script run and updated `stats/css.json` commited
11
+ - [ ] Changed tests in any of the `backstop_tests/` test suites.
12
+ - [ ] Changed the visual appearance of object(s), or changed the tests? `npm run test:build` script has been successfully run and new/changed images checked visually for correctness and committed.
16
13
 
17
- ### Linting and testing
14
+ Every time:
18
15
 
19
- - [ ] `npm run test` script has been run and visual tests pass
20
- - [ ] `npm run checks` script has been run without errors
16
+ - [ ] `npm run checks` script has been run without errors.
data/.nvmrc CHANGED
@@ -1 +1 @@
1
- 5.7
1
+ 6.9
@@ -1,166 +1,3 @@
1
1
  {
2
- "extends": "stylelint-config-standard",
3
- "rules": {
4
- "at-rule-no-vendor-prefix": true,
5
- "media-feature-name-no-vendor-prefix": true,
6
- "property-no-vendor-prefix": true,
7
- "selector-no-vendor-prefix": true,
8
- "value-no-vendor-prefix": true,
9
- "max-nesting-depth": 2,
10
- "declaration-no-important": true,
11
- "selector-no-id": true,
12
- "declaration-block-no-duplicate-properties": true,
13
- "no-unknown-animations": true,
14
- "selector-no-type": true,
15
- "no-descending-specificity": true,
16
- "declaration-block-properties-order": [
17
- "position",
18
- "top",
19
- "right",
20
- "bottom",
21
- "left",
22
- "z-index",
23
- "display",
24
- "float",
25
- "width",
26
- "height",
27
- "max-width",
28
- "max-height",
29
- "min-width",
30
- "min-height",
31
- "padding",
32
- "padding-top",
33
- "padding-right",
34
- "padding-bottom",
35
- "padding-left",
36
- "margin",
37
- "margin-top",
38
- "margin-right",
39
- "margin-bottom",
40
- "margin-left",
41
- "margin-collapse",
42
- "margin-top-collapse",
43
- "margin-right-collapse",
44
- "margin-bottom-collapse",
45
- "margin-left-collapse,",
46
- "overflow",
47
- "overflow-x",
48
- "overflow-y,",
49
- "clip",
50
- "clear,",
51
- "font",
52
- "font-family",
53
- "font-size",
54
- "font-smoothing",
55
- "osx-font-smoothing",
56
- "font-style",
57
- "font-weight",
58
- "hyphens",
59
- "src",
60
- "line-height",
61
- "letter-spacing",
62
- "word-spacing,",
63
- "color,",
64
- "text-align",
65
- "text-decoration",
66
- "text-indent",
67
- "text-overflow",
68
- "text-rendering",
69
- "text-size-adjust",
70
- "text-shadow",
71
- "text-transform,",
72
- "word-break",
73
- "word-wrap",
74
- "white-space",
75
- "vertical-align,",
76
- "list-style",
77
- "list-style-type",
78
- "list-style-position",
79
- "list-style-image,",
80
- "pointer-events",
81
- "cursor,",
82
- "background",
83
- "background-attachment",
84
- "background-color",
85
- "background-image",
86
- "background-position",
87
- "background-repeat",
88
- "background-size,",
89
- "border",
90
- "border-collapse",
91
- "border-top",
92
- "border-right",
93
- "border-bottom",
94
- "border-left",
95
- "border-color",
96
- "border-image",
97
- "border-top-color",
98
- "border-right-color",
99
- "border-bottom-color",
100
- "border-left-color",
101
- "border-spacing",
102
- "border-style",
103
- "border-top-style",
104
- "border-right-style",
105
- "border-bottom-style",
106
- "border-left-style",
107
- "border-width",
108
- "border-top-width",
109
- "border-right-width",
110
- "border-bottom-width",
111
- "border-left-width",
112
- "border-radius",
113
- "border-top-right-radius",
114
- "border-bottom-right-radius",
115
- "border-bottom-left-radius",
116
- "border-top-left-radius",
117
- "border-radius-topright",
118
- "border-radius-bottomright",
119
- "border-radius-bottomleft",
120
- "border-radius-topleft,",
121
- "content",
122
- "quotes",
123
- "outline",
124
- "outline-offset",
125
- "opacity",
126
- "filter",
127
- "visibility",
128
- "size",
129
- "zoom",
130
- "transform",
131
- "box-align",
132
- "box-flex",
133
- "box-orient",
134
- "box-pack",
135
- "box-shadow",
136
- "box-sizing",
137
- "table-layout",
138
- "animation",
139
- "animation-delay",
140
- "animation-duration",
141
- "animation-iteration-count",
142
- "animation-name",
143
- "animation-play-state",
144
- "animation-timing-function",
145
- "animation-fill-mode",
146
- "transition",
147
- "transition-delay",
148
- "transition-duration",
149
- "transition-property",
150
- "transition-timing-function",
151
- "background-clip",
152
- "backface-visibility",
153
- "will-change",
154
- "resize",
155
- "appearance",
156
- "user-select",
157
- "interpolation-mode",
158
- "direction",
159
- "marks",
160
- "page",
161
- "set-link-source",
162
- "unicode-bidi",
163
- "speak",
164
- ]
165
- }
2
+ "extends": "stylelint-config-bitcrowd"
166
3
  }
@@ -0,0 +1,19 @@
1
+ cache:
2
+ yarn: true
3
+ directories:
4
+ - node_modules
5
+ language: node_js
6
+ sudo: false
7
+ before_install:
8
+ - curl -o- -L https://yarnpkg.com/install.sh | bash
9
+ - export PATH=$HOME/.yarn/bin:$PATH
10
+ node_js:
11
+ - "6.9"
12
+ install:
13
+ - gem uninstall bundler
14
+ - gem install bundler --version '1.12'
15
+ - yarn
16
+ script:
17
+ - npm run lint
18
+ - npm run build
19
+ - npm run styleguide:build
data/README.md CHANGED
@@ -1,18 +1,32 @@
1
1
  # Bitstyles
2
2
 
3
- A developing collection of CSS styles and helpers, for use in Bitcrowd projects.
3
+ [![Build Status](https://travis-ci.org/bitcrowd/bitstyles.svg?branch=master)](https://travis-ci.org/bitcrowd/bitstyles)
4
+ [![npm version](https://badge.fury.io/js/bitstyles.svg)](https://badge.fury.io/js/bitstyles)
5
+ [![bower version](https://badge.fury.io/bo/bitstyles.svg)](https://badge.fury.io/bo/bitstyles)
6
+ [![Gem Version](https://badge.fury.io/rb/bitstyles.svg)](https://badge.fury.io/rb/bitstyles)
4
7
 
5
- ## Using Bitstyles in a project
8
+ A collection of tiny Sass CSS objects and helpers, Bitstyles is intended to be used by reasonably CSS- & HTML-aware frontend developers. This is no simple drop-in solution to skin a website, like [Bootstrap](http://getbootstrap.com) or [Foundation](http://foundation.zurb.com), rather a collection of focused object-classes, each defining just a single visual aspect. By using these simple building blocks in your HTML, it’s possible to construct complex layouts without repeating CSS.
9
+
10
+ For a certain set of elements in your UI, this strategy of applying multiple atomic classes eventually becomes untenable. This is generally for one of two reasons:
11
+ - the elements are very often-repeated, so using one class instead of many would reduce chances of inconsistency or errors e.g. buttons, cards
12
+ - the number of object classes on an element becomes unreadable in the HTML. This often also results in the appearance of the element becoming hard to reason about just from the HTML source, negating a large advantage of this approach in the first place.
6
13
 
7
- Bitstyles can be added to your project via [npm](https://www.npmjs.com/) or [Bower](http://bower.io/), as each project demands.
14
+ For components which match these criteria it may make more sense to create component classes in your project to compose several of the simpler object classes (and whatever styling you may need on top). For this reason, all the object classes are also provided as Sass mixins — `@include` them in your own Sass components as needed.
8
15
 
9
- The source repository is currently private, and is not registered with the Bower
10
- or npm registries. You will therefore need to install directly from a tagged
11
- Github release (not from master), and you will need read access to the repo.
16
+ Again unlike Bootstrap and Foundation, there are no javascript widgets or plugins included in Bitstyles.
17
+
18
+ See the [Bitcrowd frontend styleguide](https://github.com/bitcrowd/frontend) for more details of the technical principles on which Bitstyles is built. The TL;DR: it’s a variation of the BEMATOMICOOCSS methodology:
19
+ - BEM naming convention
20
+ - Atomic CSS-inspired, the object classes aim to provide most functionality needed to create whichever layout or UI you need. Trump classes create the exceptions that inevitably occur.
21
+
22
+ ## Using Bitstyles in a project
23
+
24
+ Bitstyles can be added to your project via [npm](https://www.npmjs.com/), [Bower](https://bower.io), or [RubyGems](https://rubygems.org).
12
25
 
13
26
  ### Bower
14
- ```shell
15
- bower install git@github.com:bitcrowd/bitstyles.git#0.7.5 --save
27
+
28
+ ```sh
29
+ bower install bitstyles --save
16
30
  ```
17
31
 
18
32
  Once installed, you need to provide your sass installation with the path for bitstyles’ sass. This should be:
@@ -52,8 +66,9 @@ config.assets.paths << Rails.root.join("bower_components", "bitstyles", "bitstyl
52
66
  ```
53
67
 
54
68
  ### npm
55
- ```shell
56
- npm install git+ssh://github.com/bitcrowd/bitstyles.git#0.7.5 --save
69
+
70
+ ```sh
71
+ npm install bitstyles --save
57
72
  ```
58
73
 
59
74
  Once installed, you need to provide your sass installation with the path for bitstyles’ sass. This should be:
@@ -101,15 +116,23 @@ gem 'bitstyles'
101
116
  ```
102
117
 
103
118
  And then execute:
104
- ```shell
119
+ ```sh
105
120
  bundle
106
121
  ```
107
122
 
108
123
  Or install it yourself as:
109
- ```shell
124
+ ```sh
110
125
  gem install bitstyles
111
126
  ```
112
127
 
128
+ ### Install an unpublished version
129
+
130
+ If you need to install a version of bitstyles that’s so far unpublished (e.g. there’s a bugfix or feature that’s not in a published package yet), you can use the following:
131
+
132
+ ```sh
133
+ npm install --save git+https://github.com/bitcrowd/bitstyles.git#master
134
+ ```
135
+
113
136
  ### Importing the sass to your project
114
137
 
115
138
  Copy the contents of the bitstyles manifest file (`bitstyles.scss`) to your project’s own sass manifest file (e.g. `app.scss`, `main.scss`) to make use of the entire library. Most likely you’ll not need everything in there, so comment-out the lines of objects you don’t need:
@@ -153,24 +176,30 @@ To change the css output by the library (e.g. standard margins, typographic scal
153
176
 
154
177
  For the complete list of variables you can override, look through the various files in the `bitstyles/settings/` folder.
155
178
 
156
- ## Developing Bitstyles
157
- Bitstyles requires `node v5.7.0`. If you have [nvm](https://github.com/creationix/nvm) installed:
179
+ ## Contributing
180
+
181
+ Bitstyles requires `node v5.7.0` or higher. If you have [nvm](https://github.com/creationix/nvm) installed:
158
182
 
159
- ```shell
183
+ ```sh
160
184
  nvm use
161
185
  ```
162
186
  will switch to the correct version of nodejs.
163
187
 
164
188
  Clone this repository, `cd` into the folder created, then install dependencies:
165
189
 
166
- ```shell
167
- npm install
190
+ ```sh
191
+ git clone https://github.com/bitcrowd/bitstyles.git
192
+ cd bitstyles
193
+ yarn
168
194
  ```
169
195
 
196
+ It is recommended to use [yarn](https://yarnpkg.com/en/docs/install) instead of `npm install` to ensure version consistency across dependencies.
197
+
170
198
  ### Build
199
+
171
200
  To ensure your changes do not break the build, run
172
201
 
173
- ```shell
202
+ ```sh
174
203
  npm run watch
175
204
  ```
176
205
 
@@ -178,58 +207,62 @@ to recompile sass on every change.
178
207
 
179
208
  For a single one-off build, run
180
209
 
181
- ```shell
210
+ ```sh
182
211
  npm run build
183
212
  ```
184
213
 
185
214
  ## Testing
215
+
186
216
  ### Installation
217
+
187
218
  CasperJS, PhantomJS, & BackstopJS all need to be installed globally:
188
219
 
189
- ```shell
220
+ ```sh
190
221
  npm install -g phantomjs casperjs backstopjs
191
222
  ```
192
223
 
193
224
  ### Run tests
225
+
194
226
  The project uses the visual regression testing system [BackstopJS](https://garris.github.io/BackstopJS/) to compare screenshots of each object before & after changes are made. For existing objects, if there is no visual difference between the reference images and the newly-generated images, your changes are good. For new objects, create new reference images (see below) and commit them to the repo.
195
227
 
196
228
  #### Existing objects
229
+
197
230
  If you haven’t added a new object to the `backstop.json` file, you can simply run the tests against the already-existing reference images:
198
231
 
199
232
  Start the styleguide server and leave it running:
200
233
 
201
- ```shell
234
+ ```sh
202
235
  npm run styleguide
203
236
  ```
204
237
 
205
238
  To test your changes against the known-good reference images run the tests:
206
239
 
207
- ```shell
240
+ ```sh
208
241
  npm run test
209
242
  ```
210
243
 
211
- Short results from the comparison will be displayed on the command line, more detail is available from the in-browser report:
212
-
213
- ```shell
214
- backstop openReport
215
- ```
216
-
217
- Then go to [http://localhost:3001](http://localhost:3001).
244
+ Results from the comparison will be displayed in your browser in an automatically-opened window.
218
245
 
219
246
  ### Before you create your PR
220
247
 
221
248
  Start up the styleguide (see the section below on testing for more information on this):
222
249
 
223
- ```shell
250
+ ```sh
224
251
  npm run styleguide
225
252
  ```
226
253
 
227
254
  …then run the checks:
228
255
 
229
- ```shell
256
+ ```sh
230
257
  npm run checks
231
258
  ```
232
259
 
260
+ If you’ve made changes to the Sass source, also update the stats:
261
+
262
+ ```sh
263
+ npm run css:stats
264
+ ```
265
+
233
266
  Once all tests pass, you’re good to go.
234
267
 
235
268
  #### New objects
@@ -238,13 +271,13 @@ If you add new object scenarios to the `backstop.json`, backstop will complain i
238
271
 
239
272
  Start the styleguide server:
240
273
 
241
- ```shell
274
+ ```sh
242
275
  npm run styleguide
243
276
  ```
244
277
 
245
278
  Then recreate the reference images:
246
279
 
247
- ```shell
280
+ ```sh
248
281
  npm run test:build
249
282
  ```
250
283
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
20
20
  end
21
21
 
22
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|styleguide|scripts|build)/}) }
23
23
  spec.bindir = "exe"
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
@@ -1,3 +1,3 @@
1
1
  module Bitstyles
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.1"
3
3
  end