Sheldon J. Plankton
43 |
47 | By: Da Vinci CSS - V 0.2.0
48 | View code
49 |
├── img
├── aurea.jpg
├── clone.jpg
├── grid.jpg
├── line.jpg
├── linex.jpg
├── liney.jpg
├── magic.gif
├── oval.jpg
├── rect.jpg
├── circle.jpg
├── origin.jpg
├── pixels.jpg
├── shadow.png
├── horizontal.gif
├── multline.jpg
├── plankton.jpg
├── position.jpg
├── triangle.jpg
├── vertical.gif
└── multiple-pixels.jpg
├── .gitignore
├── test
├── img
│ ├── magic.gif
│ └── unicorn.png
├── style.styl
├── index.html
└── style.css
├── demo
├── assets
│ ├── img
│ │ └── share.png
│ ├── icons
│ │ └── favicon-32.png
│ ├── stylus
│ │ └── style.styl
│ └── css
│ │ └── style.css
├── index.html
└── plankton.styl
├── .travis.yml
├── .editorconfig
├── package.json
├── .stylintrc
├── CONTRIBUTING.md
├── LICENSE.md
├── backstop.json
├── Gruntfile.js
├── da-vinci.styl
└── README.md
/img/aurea.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/aurea.jpg
--------------------------------------------------------------------------------
/img/clone.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/clone.jpg
--------------------------------------------------------------------------------
/img/grid.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/grid.jpg
--------------------------------------------------------------------------------
/img/line.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/line.jpg
--------------------------------------------------------------------------------
/img/linex.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/linex.jpg
--------------------------------------------------------------------------------
/img/liney.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/liney.jpg
--------------------------------------------------------------------------------
/img/magic.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/magic.gif
--------------------------------------------------------------------------------
/img/oval.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/oval.jpg
--------------------------------------------------------------------------------
/img/rect.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/rect.jpg
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | npm-debug.log
4 | .grunt
5 | backstop_data
6 |
--------------------------------------------------------------------------------
/img/circle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/circle.jpg
--------------------------------------------------------------------------------
/img/origin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/origin.jpg
--------------------------------------------------------------------------------
/img/pixels.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/pixels.jpg
--------------------------------------------------------------------------------
/img/shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/shadow.png
--------------------------------------------------------------------------------
/img/horizontal.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/horizontal.gif
--------------------------------------------------------------------------------
/img/multline.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/multline.jpg
--------------------------------------------------------------------------------
/img/plankton.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/plankton.jpg
--------------------------------------------------------------------------------
/img/position.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/position.jpg
--------------------------------------------------------------------------------
/img/triangle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/triangle.jpg
--------------------------------------------------------------------------------
/img/vertical.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/vertical.gif
--------------------------------------------------------------------------------
/test/img/magic.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/test/img/magic.gif
--------------------------------------------------------------------------------
/test/img/unicorn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/test/img/unicorn.png
--------------------------------------------------------------------------------
/img/multiple-pixels.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/img/multiple-pixels.jpg
--------------------------------------------------------------------------------
/demo/assets/img/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/demo/assets/img/share.png
--------------------------------------------------------------------------------
/demo/assets/icons/favicon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/afonsopacifer/da-vinci-css/HEAD/demo/assets/icons/favicon-32.png
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - stable
4 |
5 | before_install:
6 | - npm install -g grunt-cli
7 |
8 | script:
9 | - grunt lint
10 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # http://editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | indent_style = space
9 | indent_size = 2
10 | end_of_line = lf
11 | charset = utf-8
12 | trim_trailing_whitespace = true
13 | insert_final_newline = true
14 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "da-vinci-css",
3 | "version": "0.4.0",
4 | "description": "Creating shapes and drawings with CSS.",
5 | "license": "MIT",
6 | "author": {
7 | "name": "Afonso Pacifer",
8 | "email": "afonsopacifer@live.com",
9 | "url": "http://afonsopacifer.com"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/afonsopacifer/da-vinci-css"
14 | },
15 | "keywords": [
16 | "drawing",
17 | "css",
18 | "stylus"
19 | ],
20 | "devDependencies": {
21 | "autoprefixer-core": "^5.2.0",
22 | "backstopjs": "^1.2.1",
23 | "grunt": "^0.4.5",
24 | "grunt-contrib-connect": "^0.8.0",
25 | "grunt-contrib-stylus": "^0.20.0",
26 | "grunt-contrib-watch": "^0.6.1",
27 | "grunt-gh-pages": "^0.10.0",
28 | "grunt-postcss": "^0.4.0",
29 | "grunt-stylint": "^0.1.2",
30 | "stylus": "^0.50.0"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/demo/assets/stylus/style.styl:
--------------------------------------------------------------------------------
1 | // Da Vinci CSS
2 | @import "../../../da-vinci"
3 |
4 | // Demos
5 | @import "../../plankton"
6 |
7 | /* Colors
8 | _____________________________________________________ */
9 | highlight = #eb02dd
10 |
11 | *
12 | box-sizing border-box
13 |
14 | body
15 | font-family 'Roboto', sans-serif
16 | font-weight 300
17 | background-color #eee
18 | color #595959
19 |
20 | .main
21 | width 100%
22 | padding 30px
23 |
24 | .demo
25 | background #fff
26 | display inline-block
27 | padding 15px
28 |
29 | .demo h2
30 | margin 0 0 15px 0
31 |
32 | .link
33 | color highlight
34 | text-decoration none
35 | font-weight 300
36 | padding 10px 0
37 | display inline-block
38 |
39 | .link-btn
40 | background highlight
41 | color #fff
42 | text-decoration none
43 | font-weight 300
44 | padding 5px 10px
45 | display inline-block
46 | transition opacity .3
47 |
48 | .link-btn:hover
49 | opacity .8
50 |
51 | .link:hover
52 | text-decoration underline
53 |
--------------------------------------------------------------------------------
/.stylintrc:
--------------------------------------------------------------------------------
1 | {
2 | "blocks": false,
3 | "brackets": "never",
4 | "colons": "never",
5 | "colors": "always",
6 | "commaSpace": "always",
7 | "commentSpace": "always",
8 | "cssLiteral": "never",
9 | "depthLimit": false,
10 | "duplicates": true,
11 | "efficient": "always",
12 | "extendPref": false,
13 | "globalDupe": false,
14 | "indentPref": false,
15 | "leadingZero": "never",
16 | "maxErrors": false,
17 | "maxWarnings": false,
18 | "mixed": false,
19 | "namingConvention": false,
20 | "namingConventionStrict": false,
21 | "none": "never",
22 | "noImportant": true,
23 | "parenSpace": false,
24 | "placeholders": "always",
25 | "prefixVarsWithDollar": "always",
26 | "quotePref": false,
27 | "semicolons": "never",
28 | "sortOrder": "alphabetical",
29 | "stackedProperties": "never",
30 | "trailingWhitespace": "never",
31 | "universal": false,
32 | "valid": true,
33 | "zeroUnits": "never",
34 | "zIndexNormalize": false
35 | }
36 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | 1. Fork it!
4 |
5 | 2. Create your feature branch:
6 | ```sh
7 | $ git checkout -b my-new-feature
8 | ```
9 |
10 | 3. Install all dependencies:
11 | ```sh
12 | $ npm install
13 | ```
14 |
15 | 4. Create the references to the regression test:
16 | ```sh
17 | $ cd node_modules/backstopjs
18 | $ npm run reference
19 | $ cd ../..
20 | ```
21 | 5. Create your feature:
22 |
23 | 
24 |
25 | 6. Run lint process:
26 | ```
27 | $ grunt lint
28 | ```
29 | 7. Run the regression test:
30 | ```sh
31 | $ cd node_modules/backstopjs
32 | $ npm run test
33 | $ cd ../..
34 | ```
35 | 8. Write your visual regression test **(Not mandatory)**
36 |
37 | 9. Commit your changes:
38 | ```
39 | $ git commit -m 'Add some feature'
40 | ```
41 |
42 | 10. Push to the branch:
43 | ```
44 | $ git push origin my-new-feature
45 | ```
46 |
47 | 11. Submit a pull request
48 |
49 | **PS:** *After your pull request is merged, you can safely delete your branch.*
50 |
51 | ### [<-- Back](https://github.com/afonsopacifer/da-vinci-css/)
52 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Afonso Pacifer, [afonsopacifer.com](http://afonsopacifer.com/)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/backstop.json:
--------------------------------------------------------------------------------
1 | {
2 | "viewports": [
3 | {
4 | "name": "default",
5 | "width": 1200,
6 | "height": 480
7 | }
8 | ],
9 | "scenarios": [
10 | {
11 | "label": "Da Vinci CSS",
12 | "url": "../../test/index.html",
13 | "hideSelectors": [],
14 | "removeSelectors": [
15 | ],
16 | "selectors": [
17 | ".test-rect",
18 | ".test-circ",
19 | ".test-oval",
20 | ".test-tri",
21 | ".test-grid",
22 | ".test-origin",
23 | ".test-pixel",
24 | ".test-line",
25 | ".test-lineX",
26 | ".test-lineY",
27 | ".test-all",
28 | ".test-img",
29 | ".test-pos",
30 | ".test-flip-vertical",
31 | ".test-flip-horizontal",
32 | ".test-clone",
33 | ".test-shadow"
34 | ],
35 | "readyEvent": null,
36 | "delay": 0,
37 | "onBeforeScript": null,
38 | "onReadyScript": null
39 | }
40 | ],
41 | "paths": {
42 | "bitmaps_reference": "../../backstop_data/bitmaps_reference",
43 | "bitmaps_test": "../../backstop_data/bitmaps_test",
44 | "compare_data": "../../backstop_data/bitmaps_test/compare.json",
45 | "casper_scripts": "../../backstop_data/casper_scripts"
46 | },
47 | "engine": "phantomjs",
48 | "report": ["CLI", "browser"],
49 | "cliExitOnFail": false,
50 | "casperFlags": [],
51 | "debug": false,
52 | "port": 3001
53 | }
54 |
--------------------------------------------------------------------------------
/test/style.styl:
--------------------------------------------------------------------------------
1 | // Da Vinci CSS
2 | @import "../da-vinci"
3 |
4 | /* Colors
5 | _____________________________________________________ */
6 | highlight = #eb02dd
7 |
8 | *
9 | box-sizing border-box
10 |
11 | body
12 | background-color #eee
13 |
14 | .main
15 | width 100%
16 | margin 0 auto
17 | max-width 1200px
18 |
19 | .section
20 | display flex
21 | flex-wrap wrap
22 |
23 | .section-title
24 | width 100%
25 | color highlight
26 | border-bottom 3px solid highlight
27 | padding-bottom 5px
28 |
29 | .demo
30 | background #fff
31 | padding 5px
32 | margin 5px
33 | width 230px
34 | position relative
35 |
36 | .demo-title
37 | margin 0 0 15px 0
38 | border-bottom 3px solid #eee
39 | padding-bottom 5px
40 |
41 | .test-pos
42 | position relative
43 | width 220px
44 | height 200px
45 |
46 | /* Basic shapes
47 | ------------------------------------------------ */
48 |
49 | //rect
50 | .rect
51 | rect(100px, 100px, highlight)
52 |
53 | //circ
54 | .circ
55 | circ(50px, highlight)
56 |
57 | //oval
58 | .oval
59 | oval(100px, 70px, highlight)
60 |
61 | //tri
62 | .tri
63 | tri(100px, 50px, 50px,highlight)
64 |
65 | /* Pixel Art
66 | ------------------------------------------------ */
67 |
68 | //grid
69 | .grid
70 | grid(30px, 6, #000)
71 |
72 | //origin
73 | .origin
74 | origin(1,1,30px,#000)
75 |
76 | //pixel
77 | .pixel
78 | origin(1,1,30px,#000)
79 | box-shadow: pixel(2,2,30px,#000);
80 |
81 | //line
82 | .line
83 | origin(1,1,30px,#000)
84 | box-shadow: line(2..6,30px,highlight);
85 |
86 | //lineX
87 | .lineX
88 | origin(1,1,30px,#000)
89 | box-shadow: lineX(2..6,30px,highlight);
90 |
91 | //lineY
92 | .lineY
93 | origin(1,1,30px,#000)
94 | box-shadow: lineY(2..6,30px,highlight);
95 |
96 | //all
97 | .all
98 | a = 30px
99 | origin(1, 1, a, #eb02dd)
100 | box-shadow:
101 | pixel(3, 4, a, #eb02dd),
102 | line(2..6, a, purple),
103 | lineY(2..6, a, pink),
104 | lineX(2..6, a, pink);
105 |
106 | /* Images
107 | ------------------------------------------------ */
108 |
109 | //img
110 | .img
111 | img("img/magic.gif", 200px, 200px)
112 |
113 | /* Edit
114 | ------------------------------------------------ */
115 |
116 | //pos
117 | .pos
118 | rect(100px, 50px, #eb02dd)
119 | pos(50px, 50px, 1)
120 |
121 | //flip vertival
122 | .flip-vertical
123 | img("img/magic.gif", 200px, 200px)
124 | flip(vertical)
125 |
126 | //flip horizontal
127 | .flip-horizontal
128 | img("img/magic.gif", 200px, 200px)
129 | flip(horizontal)
130 |
131 | //clone
132 | .clone
133 | rect(100px, 100px, #eb02dd)
134 | clone(110px, 0, #ccc)
135 |
136 | //shadow
137 | .shadow
138 | img("img/unicorn.png", 200px, 200px)
139 | shadow(5px, 5px, 5px, #000)
140 |
--------------------------------------------------------------------------------
/demo/assets/css/style.css:
--------------------------------------------------------------------------------
1 | .canvas{background:linear-gradient(to top,transparent 94%,#000 94%) repeat-x,linear-gradient(to bottom,transparent 94%,#000 94%),linear-gradient(to left,transparent 94%,#000 94%) repeat-y,linear-gradient(to right,transparent 94%,#000 94%);background-size:10px;height:170px;position:relative;width:170px}.plankton{background-color:#2c2e2d;height:10px;width:10px;box-shadow:10px 0 #2c2e2d,90px 0 #2c2e2d,100px 0 #2c2e2d,0 10px #2c2e2d,10px 10px #008543,20px 10px #2c2e2d,80px 10px #2c2e2d,90px 10px #008543,100px 10px #2c2e2d,10px 20px #2c2e2d,20px 20px #008543,30px 20px #2c2e2d,70px 20px #2c2e2d,80px 20px #008543,90px 20px #2c2e2d,20px 30px #2c2e2d,30px 30px #008543,40px 30px #2c2e2d,60px 30px #2c2e2d,70px 30px #008543,80px 30px #2c2e2d,20px 40px #2c2e2d,30px 40px #008543,40px 40px #2c2e2d,50px 40px #2c2e2d,60px 40px #2c2e2d,70px 40px #008543,80px 40px #2c2e2d,30px 50px #2c2e2d,40px 50px #008543,50px 50px #008543,60px 50px #008543,70px 50px #2c2e2d,20px 60px #2c2e2d,30px 60px #008543,40px 60px #008543,50px 60px #03ad55,60px 60px #03ad55,70px 60px #03ad55,80px 60px #2c2e2d,20px 70px #2c2e2d,30px 70px #008543,40px 70px #2c2e2d,50px 70px #2c2e2d,60px 70px #2c2e2d,70px 70px #03ad55,80px 70px #2c2e2d,20px 80px #2c2e2d,30px 80px #008543,40px 80px #fcd808,50px 80px #f9ff43,60px 80px #f9ff43,70px 80px #03ad55,80px 80px #2c2e2d,10px 90px #2c2e2d,20px 90px #008543,30px 90px #008543,40px 90px #fcd808,50px 90px #b02522,60px 90px #f9ff43,70px 90px #03ad55,80px 90px #03ad55,90px 90px #2c2e2d,0 100px #2c2e2d,10px 100px #008543,20px 100px #2c2e2d,30px 100px #008543,40px 100px #fcd808,50px 100px #fcd808,60px 100px #fcd808,70px 100px #03ad55,80px 100px #2c2e2d,90px 100px #03ad55,100px 100px #2c2e2d,0 110px #2c2e2d,10px 110px #008543,20px 110px #2c2e2d,30px 110px #008543,40px 110px #03ad55,50px 110px #03ad55,60px 110px #03ad55,70px 110px #03ad55,80px 110px #2c2e2d,90px 110px #03ad55,100px 110px #2c2e2d,10px 120px #2c2e2d,20px 120px #2c2e2d,30px 120px #008543,40px 120px #03ad55,50px 120px #03ad55,60px 120px #03ad55,70px 120px #03ad55,80px 120px #2c2e2d,90px 120px #2c2e2d,20px 130px #2c2e2d,30px 130px #008543,40px 130px #008543,50px 130px #03ad55,60px 130px #03ad55,70px 130px #03ad55,80px 130px #2c2e2d,30px 140px #2c2e2d,40px 140px #008543,50px 140px #008543,60px 140px #008543,70px 140px #2c2e2d,20px 150px #2c2e2d,30px 150px #008543,40px 150px #2c2e2d,50px 150px #2c2e2d,60px 150px #2c2e2d,70px 150px #008543,80px 150px #2c2e2d,20px 160px #2c2e2d,30px 160px #2c2e2d,40px 160px #2c2e2d,60px 160px #2c2e2d,70px 160px #2c2e2d,80px 160px #2c2e2d}*{box-sizing:border-box}body{font-family:'Roboto',sans-serif;font-weight:300;background-color:#eee;color:#595959}.main{width:100%;padding:30px}.demo{background:#fff;display:inline-block;padding:15px}.demo h2{margin:0 0 15px 0}.link{color:#eb02dd;text-decoration:none;font-weight:300;padding:10px 0;display:inline-block}.link-btn{background:#eb02dd;color:#fff;text-decoration:none;font-weight:300;padding:5px 10px;display:inline-block;transition:opacity .3}.link-btn:hover{opacity:.8}.link:hover{text-decoration:underline}
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function( grunt ) {
2 |
3 | "use strict"
4 |
5 | grunt.initConfig({
6 |
7 | pkg: grunt.file.readJSON('package.json'),
8 |
9 | // watch
10 | watch: {
11 |
12 | html: {
13 | files: 'demo/*.html',
14 | },
15 |
16 | styl: {
17 | files: ['demo/assets/stylus/*.styl', 'da-vinci.styl'],
18 | tasks: ['stylus:compile','stylint'],
19 | },
20 |
21 | test: {
22 | files: ['test/*.styl'],
23 | tasks: ['stylus:test','autoprefixer'],
24 | },
25 |
26 | css: {
27 | files: 'demo/assets/css/*.css',
28 | },
29 |
30 | options: {
31 | livereload: true
32 | }
33 |
34 | },
35 |
36 | // stylus
37 | stylus: {
38 | options: {
39 | compress: true,
40 | },
41 | compile: {
42 | files: {
43 | 'demo/assets/css/style.css':'demo/assets/stylus/style.styl' // 1:1 compile
44 | }
45 | },
46 | test: {
47 | files: {
48 | 'test/style.css':'test/style.styl' // 1:1 compile
49 | }
50 | }
51 | },
52 |
53 | stylint: {
54 | src: ['da-vinci.styl']
55 | },
56 |
57 | //Post CSS for autoprefixer :)
58 | postcss: {
59 | options: {
60 | cascade: false,
61 | map: true,
62 | processors: [
63 | require('autoprefixer-core')({browsers: 'last 2 version, ie >= 9'})
64 | ]
65 | },
66 | dist: {
67 | src: ['test/*.css']
68 | }
69 | },
70 |
71 | //Deploy the production files for gh-pages
72 | 'gh-pages': {
73 | options: {
74 | base: 'demo/'
75 | },
76 | src: ['**']
77 | },
78 |
79 | // connect
80 | connect: {
81 |
82 | demo: {
83 | options: {
84 | port: 9000,
85 | base: "demo/",
86 | hostname: "localhost",
87 | livereload: true,
88 | open: true
89 | }
90 | },
91 | test: {
92 | options: {
93 | port: 9000,
94 | base: "test/",
95 | hostname: "localhost",
96 | livereload: true,
97 | open: true
98 | }
99 | }
100 |
101 | }
102 |
103 | });
104 |
105 | // plugins
106 | grunt.loadNpmTasks('grunt-contrib-stylus');
107 | grunt.loadNpmTasks('grunt-contrib-watch');
108 | grunt.loadNpmTasks('grunt-contrib-connect');
109 | grunt.loadNpmTasks('grunt-gh-pages');
110 | grunt.loadNpmTasks('grunt-postcss');
111 | grunt.loadNpmTasks('grunt-stylint');
112 |
113 | // tasks demo
114 | grunt.registerTask( 'serve', ['connect:demo','watch']);
115 | grunt.registerTask( 'deploy', ['gh-pages']);
116 |
117 | // tasks test
118 | grunt.registerTask( 'lint', ['stylint']);
119 | grunt.registerTask( 'create-test', ['connect:test','watch']);
120 | grunt.registerTask( 'autoprefixer', ['postcss']);
121 | };
122 |
--------------------------------------------------------------------------------
/da-vinci.styl:
--------------------------------------------------------------------------------
1 | /*
2 | Da Vinci CSS
3 | Platform: Stylus
4 |
5 | Original repository:
6 | https://github.com/afonsopacifer/da-vinci-css
7 | Author:
8 | Afonso Pacifer (afonsopacifer.com)
9 | Version: 0.4.0
10 | Licence:
11 | MIT - https://github.com/afonsopacifer/da-vinci-css/blob/master/licence.md
12 | */
13 |
14 | /* Basic shapes
15 | ------------------------------------------------ */
16 |
17 | // rectangle
18 | rect($w, $h, $c = #eb02dd)
19 | background-color $c
20 | height $h
21 | width $w
22 |
23 | // circle
24 | circ($r, $c = #eb02dd)
25 | background-color $c
26 | border-radius 50%
27 | height $r * 2
28 | width $r * 2
29 |
30 | // oval
31 | oval($w, $h, $c = #eb02dd)
32 | background-color $c
33 | border-radius 50%
34 | height $h
35 | width $w
36 |
37 | // triangle
38 | tri($t, $l, $r, $c = #eb02dd)
39 | border-bottom $t solid $c
40 | border-left $l solid transparent
41 | border-right $r solid transparent
42 | height 0
43 | width 0
44 |
45 | /* Pixel Art
46 | ------------------------------------------------ */
47 |
48 | // grid
49 | grid($cell-size, $grid-size = 4, $stroke-color = #000)
50 | background linear-gradient(to top, transparent 94%, $stroke-color 94%) repeat-x, linear-gradient(to bottom, transparent 94%, $stroke-color 94%), linear-gradient(to left, transparent 94%, $stroke-color 94%) repeat-y, linear-gradient(to right, transparent 94%, $stroke-color 94%)
51 | background-size $cell-size
52 | height $cell-size * $grid-size
53 | position relative
54 | width $cell-size * $grid-size
55 |
56 | // origin
57 | origin($r, $cl, $s, $c = #000)
58 | background-color $c
59 | height $s
60 | left $s * ($r - 1)
61 | position absolute
62 | top $s * ($cl - 1)
63 | width $s
64 |
65 | // pixel
66 | pixel($r, $cl, $s, $c = #000)
67 | ($s * ($cl - 1)) ($s * ($r - 1)) $c
68 |
69 | p($r, $cl, $s, $c = #000)
70 | ($s * ($cl - 1)) ($s * ($r - 1)) $c
71 |
72 | // line
73 | line($range, $s, $c = #000)
74 | $pixels = '0 0 #000'
75 | for $n in $range
76 | $pixels += ', ' + ($n - 1)*$s + ' ' + ($n - 1)*$s + ' '
77 | $pixels += $c
78 | return unquote($pixels)
79 |
80 | // lineX
81 | lineX($range, $s, $c = #000)
82 | $pixels = '0 0 #000'
83 | for $n in $range
84 | $pixels += ', ' + ($n - 1)*$s + ' ' + 0 + ' '
85 | $pixels += $c
86 | return unquote($pixels)
87 |
88 | // lineY
89 | lineY($range, $s, $c = #000)
90 | $pixels = '0 0 #000'
91 | for $n in $range
92 | $pixels += ', ' + 0 + ' ' + ($n - 1)*$s + ' '
93 | $pixels += $c
94 | return unquote($pixels)
95 |
96 | /* Images
97 | ------------------------------------------------ */
98 |
99 | // img
100 | img($url, $w, $h)
101 | background-image url($url)
102 | background-repeat no-repeat
103 | background-size $w $h
104 | height $h
105 | width $w
106 |
107 | /* Edit
108 | ------------------------------------------------ */
109 |
110 | // position
111 | pos($x, $y, $z = 1)
112 | left $y
113 | position absolute
114 | top $x
115 | z-index $z
116 |
117 | // flip
118 | flip($x = horizontal)
119 | if $x == "horizontal"
120 | transform rotateY(180deg)
121 | if $x == "vertical"
122 | transform rotateX(180deg)
123 |
124 | // clone
125 | clone($x, $y, $c = #eb02dd)
126 | box-shadow $x $y $c
127 |
128 | // shadow
129 | shadow($x, $y, $dissipation, $c = #eb02dd)
130 | filter drop-shadow($x $y $dissipation $c)
131 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
47 | By: Da Vinci CSS - V 0.2.0
48 | View code
49 |