Skip to content

Commit d357366

Browse files
committed
Merge branch 'release/4.0.0-alpha.1'
2 parents 522f92a + 776f2f3 commit d357366

File tree

250 files changed

+8720
-6067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+8720
-6067
lines changed
File renamed without changes.

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ end_of_line = lf
88
indent_size = 2
99
indent_style = space
1010
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

.gitignore

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
.DS_Store
1+
# Numerous always-ignore extensions
2+
*.diff
3+
*.err
4+
*.log
5+
*.orig
6+
*.rej
7+
*.swo
8+
*.swp
9+
*.vi
10+
*.zip
11+
*~
212

3-
/template-project/scss/*/*.scss
13+
# OS or Editor folders
14+
._*
15+
.cache
16+
.DS_Store
17+
.idea
18+
.project
19+
.settings
20+
.tmproj
21+
*.esproj
22+
*.sublime-project
23+
*.sublime-workspace
24+
nbproject
25+
Thumbs.db
426

27+
# Folders to ignore
28+
backstop_data
29+
bitmaps_test
30+
bower_components
31+
dist
532
node_modules
6-
7-
# DEPRECATED
8-
/package_dev
9-
/vendor
33+
sassdoc
34+
tmp

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.editorconfig
2+
3+
CONTRIBUTING.md
4+
5+
test

.stylelintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const declarationBlockPropertiesOrder = require(`./.csscomb.json`)[`sort-order`][0];
2+
3+
module.exports = {
4+
extends: `stylelint-config-modularis`,
5+
rules: {
6+
'declaration-block-properties-order': declarationBlockPropertiesOrder,
7+
},
8+
};

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- "node"
4+
install:
5+
- npm install -g yarn
6+
- yarn
7+
script:
8+
- bash test/test.sh

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Found a problem? Want a new feature?
55
- See if your issue or idea has [already been reported].
66
- Provide a [reduced test case] or a [live example].
77

8-
Remember, a bug is a _demonstrable problem_ caused by _our_ code.
8+
Remember, a bug is a *demonstrable problem* caused by *our* code.
99

1010
## Submitting Pull Requests
1111

LICENSE

Lines changed: 21 additions & 340 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 16 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,29 @@
11
# avalanche
2-
avalanche is a modular front-end framework which can be extended with npm
3-
packages. The goal is to provide a workflow to manage the complexity of big
4-
front-end projects.
2+
[![Build Status](https://travis-ci.org/avalanchesass/avalanche.svg?branch=master)](https://travis-ci.org/avalanchesass/avalanche)
53

6-
## Getting started
7-
### Quick start
8-
- Install [npm](https://docs.npmjs.com/getting-started/installing-node) and
9-
[gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md) on
10-
your system (if not already installed).
11-
- Install avalanche globally `npm install -g avalanchesass`.
12-
- Run `avalanchesass --template="project" --name="Your project name"` to create
13-
a new avalanche project in the current directory.
14-
- Run `npm install` inside your newly created project directory.
15-
- Run `gulp` to start the build process.
4+
avalanche establishes the foundation for a package based CSS workflow. Heavy weight CSS toolkits often stay in your way when creating unique looking experiences or they lead to a rather bland design. But you don't have to reinvent the wheel for every new project either. avalanche provides building blocks for you to handpick and integrate into your workflow.
165

17-
### Extend avalanche
18-
The high modularity of avalanche requires that every part of the system is a
19-
distinct package. There are multiple package types:
6+
## Get started
7+
avalanche comes with a CLI to kickstart new projects:
208

21-
- **Function:** custom SASS functions
22-
- **Base:** base styles like typography and other global default styles (mostly
23-
unclassed HTML elements)
24-
- **Object:** non-cosmetic styles (such as the famous media object)
25-
- **Component:** concrete, implementation-specific piece of UI
26-
- **Utility:** utility classes that do specific things (for example clearfix)
27-
28-
You can find various available packages on
29-
[npm](https://www.npmjs.com/browse/keyword/avalanchesass-package)
30-
To extend your installation with a preconfigured package open your
31-
`package.json` file, add the package to your *dependencies* and run
32-
`npm install` afterwards.
33-
34-
```json
35-
"dependencies": {
36-
"avalanchesass_base_default": "^3.0.0",
37-
"avalanchesass_base_form": "^3.0.0",
38-
"avalanchesass_base_typography": "^3.0.0",
39-
"avalanchesass_object_media": "^3.0.0",
40-
"normalize-scss": "^4.0.3"
41-
}
42-
```
43-
44-
## Working with avalanche
45-
### Extend packages
46-
If you wan’t to make changes to a class defined by a package it is recommended
47-
to create a custom package with the name `_PACKAGE_NAME_extend.scss` in the scss
48-
directory of your project.
49-
50-
#### Example
51-
Extending the `.c-button` class of the button component:
52-
53-
- Create a file `_button_extend.scss` in `scss/component`.
54-
- Define the `.c-button` class and override or change it’s properties.
55-
- You can also remove properties by setting their value to `initial` and adding
56-
a `/*!remove*/` comment at the end of the line.
57-
58-
```scss
59-
.c-button {
60-
padding: initial;/*!remove*/
61-
text-transform: uppercase;
62-
}
9+
```bash
10+
# Install the avalanche CLI.
11+
npm install @avalanche/cli -g
12+
# Create a new project with the name "Your Project Name".
13+
avalanche "Your Project Name"
6314
```
6415

65-
**Attention:** removing properties and merging extended classes, will only
66-
happen in the minified version of the CSS code. But the styling of your site
67-
will be the same: setting a property value to `initial` has the same effect as
68-
removing the property from the original class. Extending the original class by
69-
defining it a second time, uses the default cascading behavior of CSS.
70-
71-
### Override package variables
72-
Most packages define there own default variables which you can override to
73-
change the CSS output. There are two ways how to override variables of external
74-
and custom packages:
75-
76-
1. Similar to the extending of packages, you can create a separate file in which
77-
you define the variables you want to override (for example
78-
`_button_variable.scss`).
79-
2. If you prefer to have one big file with all the variables inside, you can
80-
also override package variables inside the `_variable.scss` file in your
81-
projects `scss` directory.
82-
83-
### CLI
84-
`avalanchesass --template="" [--type=""] [--name=""] [--path=""]`
85-
86-
#### Options
87-
- `--template` *mandatory*
88-
possible values: project | package | package-custom
89-
- `--type` *optional*
90-
possible values: Function | Base | Object | Component | Utility
91-
default value: Component
92-
- `--name` *optional*
93-
possible values: "Your Project Name"
94-
default value: "Avalanche Project"
95-
- `--path` *optional*
96-
possible values: /path/to/somewhere
97-
default value: current working directory
98-
99-
#### Examples
100-
**Create a project**
101-
`avalanchesass --template="project" --name="Project Name"`
102-
103-
**Create a `Component` package**
104-
`avalanchesass --template="package" --type="Component" --name="Package Name"`
105-
106-
**Create a custom `Object` package** *assuming you are in the project diretory*
107-
`avalanchesass --template="package-custom" --type="Object" --name="Package Name" --path="scss/object"`
108-
109-
### BEM
110-
avalanche uses the [BEM syntax](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/).
111-
To make the meaning of the classes more transparent every BEM class name is
112-
[namespaced](http://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces/).
113-
The BEM syntax helps to prevent [side effects in CSS](http://philipwalton.com/articles/side-effects-in-css/)
114-
and the informative nature of the naming convention makes it ideal for teams and
115-
larger projects.
116-
117-
```css
118-
.c-block {}
119-
.c-block__element {}
120-
.c-block--modifier {}
16+
avalanche is flexible in the way you can use it – it is also very easy to integrate avalanche packages into your existing project. [Learn more about how to use avalanche](https://avalanche.oberlehner.net/get-started/).
12117

122-
.c-menu {}
123-
.c-menu__link {}
124-
.c-menu--horizontal {}
125-
```
126-
127-
### Style guide
128-
avalanche uses [mdcss](https://github.com/jonathantneal/mdcss) to automatically
129-
generate a style guide from CSS comments in markdown syntax
130-
([avalanche style guide DEMO](http://avalanche.oberlehner.net)).
131-
132-
Please follow the [official mdcss documentation](https://github.com/jonathantneal/mdcss#writing-documentation)
133-
on how to format comments in your SCSS code for the style guide.
134-
135-
To generate the style guide run `gulp style_guide`. You can also run
136-
`gulp watch:style_guide` instead of the default `gulp` task to start the build
137-
process. This automatically generates the style guide on every change you make
138-
to your code base.
139-
140-
### CSS extraction
141-
[HTTP/2](https://en.wikipedia.org/wiki/HTTP/2) is coming and changes the way
142-
[how we should build websites](https://mattwilcox.net/web-development/http2-for-front-end-web-developers).
143-
With HTTP/2 it can be faster to load multiple small files (but only those which
144-
are really needed) instead of one big file (with a potential overhead). Example:
145-
the pager component isn’t used on most of your pages but the styles are loaded
146-
on every request because they are concatenated into one big file.
147-
148-
With CSS extraction you can split your styles into multiple separate CSS files.
149-
This makes it possible to load just the styles you need. Amongst other things
150-
there are the following advantages using this technique:
151-
152-
- Increased cache granularity (avoids invalidating a whole sprite or
153-
concatenated bundle when just a single part changes)
154-
- Parallel downloading of files that before were bundled into one file
155-
- Less energy/memory usage in the client
156-
157-
By default every avalanche package is prepared for CSS extraction.
158-
Run `gulp styles:extract` to create the CSS files - you can find them in
159-
`dist-extract`. Or you can start a watch task with CSS extraction enabled:
160-
`gulp watch:extract`.
161-
162-
To make your custom packages CSS extraction ready, you have to add special
163-
placeholder comments.
164-
165-
```css
166-
/* extract component_PACKAGE_NAME.css */
167-
.c-PACKAGE_NAME { … }
168-
/* end extract component_PACKAGE_NAME.css */
169-
```
170-
171-
To prevent naming collisions it is recommended to add the package type as a
172-
prefix to the name of the desired resulting CSS file. If you define two or more
173-
extraction sections with the same name, those are combined into one file.
174-
175-
It is recommended to also add placeholder comments for the package type. Because
176-
extraction sections with the same name are combined you end up with separate
177-
files per package type.
178-
179-
```css
180-
/* extract component.css */
181-
/* extract component_PACKAGE_NAME.css */
182-
.c-PACKAGE_NAME { … }
183-
/* end extract component_PACKAGE_NAME.css */
184-
/* end extract component.css */
185-
```
18+
## Testing
19+
- Test all packages at once: `npm test`
20+
- Test a specific package: `npm test -- -p PACKAGE-NAME`
18621

18722
## About
18823
### Author
18924
Markus Oberlehner
190-
Twitter: https://twitter.com/MaOberlehner
25+
Twitter: https://twitter.com/MaOberlehner
26+
PayPal.me: https://paypal.me/maoberlehner
19127

19228
### License
193-
GPL v2 (http://www.gnu.org/licenses/gpl-2.0.html)
29+
MIT

backstop.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"viewports": [
3+
{
4+
"name": "s",
5+
"width": 480,
6+
"height": 270
7+
},
8+
{
9+
"name": "m",
10+
"width": 720,
11+
"height": 405
12+
},
13+
{
14+
"name": "l",
15+
"width": 960,
16+
"height": 540
17+
},
18+
{
19+
"name": "xl",
20+
"width": 1200,
21+
"height": 675
22+
}
23+
],
24+
"scenarios": [
25+
{
26+
"label": "avalanche",
27+
"url": "test/tmp/test.html",
28+
"selectors": [
29+
"document"
30+
],
31+
"readyEvent": null,
32+
"delay": 500,
33+
"misMatchThreshold" : 0.1
34+
}
35+
],
36+
"paths": {
37+
"bitmaps_reference": "test/backstopjs/bitmaps_reference",
38+
"bitmaps_test": "test/backstopjs/bitmaps_test",
39+
"compare_data": "test/backstopjs/bitmaps_test/compare.json",
40+
"casper_scripts": "test/backstopjs/casper_scripts"
41+
},
42+
"engine": "phantomjs",
43+
"report": ["CLI", "browser"],
44+
"cliExitOnFail": false,
45+
"casperFlags": [],
46+
"debug": false,
47+
"port": 9999
48+
}

0 commit comments

Comments
 (0)