boxmodel2 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4fb8fe73cc9b8af9ae0513589b10934585ab0b10
4
+ data.tar.gz: 43172ed9af644a05f60685dbf64c515624309ac1
5
+ SHA512:
6
+ metadata.gz: ddf2c4c284d83a506e9d180217d57d7dad3ca764a4c444f5aae86707f4a345ce981e8c53f48963fa5a1c70475257c3fdcfb92420a896a59204b4ba3495bc8e93
7
+ data.tar.gz: 433191146107baff21ebb1066568ddc88c0c4fad6c5c9b440b1c76a2ff2d48ec72de7f1f2cb84ff1cc3d78b257e8f10e4577c3641d1365c9a6bbfe881b67030a
@@ -0,0 +1 @@
1
+ .sass-cache
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 pawelrosa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1 @@
1
+ # boxmodel2
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'boxmodel2/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'boxmodel2'
8
+ s.version = Boxmodel2::VERSION
9
+ s.license = 'MIT'
10
+ s.date = '2015-03-21'
11
+
12
+ s.summary = "Boxmodel2, css classes modifying box model"
13
+ s.description = "Boxmodel2 is css library providing css classes to modify margins, paddings, borders, dimensions and positions without writing css declarations by yourself."
14
+
15
+ s.authors = ["Paweł Rosa"]
16
+ s.email = 'pawel.t.rosa@gmail.com'
17
+ s.homepage = 'https://github.com/pawelrosa/boxmodel2'
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.require_paths = ['lib']
21
+
22
+ s.add_dependency 'sass', '>= 3.4'
23
+ end
@@ -0,0 +1,3 @@
1
+ module Boxmodel2
2
+ VERSION = '0.0.0'
3
+ end
@@ -0,0 +1,9 @@
1
+ /*----------------------------------------------------------------------------*/
2
+ /* BOXMODEL2 -----------------------------------------------------------------*/
3
+ /*----------------------------------------------------------------------------*/
4
+
5
+ @import "boxmodel2/vars";
6
+ @import "boxmodel2/mixins";
7
+ @import "boxmodel2/disabling_classes";
8
+ @import "boxmodel2/main_classes";
9
+ @import "boxmodel2/responsive_classes";
@@ -0,0 +1,5 @@
1
+ //----------------------------------------------------------------------------//
2
+ // BOXMODEL2 > DISABLING_CLASSES ---------------------------------------------//
3
+ //----------------------------------------------------------------------------//
4
+
5
+ @include all-disabling-classes;
@@ -0,0 +1,5 @@
1
+ //----------------------------------------------------------------------------//
2
+ // BOXMODEL2 > MAIN_CLASSES---------------------------------------------------//
3
+ //----------------------------------------------------------------------------//
4
+
5
+ @include all-main-classes;
@@ -0,0 +1,220 @@
1
+ //----------------------------------------------------------------------------//
2
+ // BOXMODEL2 > MIXINS --------------------------------------------------------//
3
+ //----------------------------------------------------------------------------//
4
+
5
+ @mixin direction-expressions($type, $direction, $value) {
6
+ $v: $value;
7
+ $b: null;
8
+ @if $value != 0 {
9
+ $v: $value * 1px;
10
+ }
11
+ @if $type == border {
12
+ $b: -width;
13
+ }
14
+ @if $direction == all {
15
+ #{$type}#{$b}: $v !important;
16
+ } @else if $direction == horizontal {
17
+ #{$type}-left#{$b}: $v !important;
18
+ #{$type}-right#{$b}: $v !important;
19
+ } @else if $direction == vertical {
20
+ #{$type}-top#{$b}: $v !important;
21
+ #{$type}-bottom#{$b}: $v !important;
22
+ } @else {
23
+ #{$type}-#{$direction}#{$b}: $v !important;
24
+ }
25
+ }
26
+
27
+ @mixin direction-classes($type, $value, $res: null) {
28
+ @if $value > 0 or $type == margin and $value != 0 {
29
+ $t: str-slice($type, 0, 1);
30
+ $r: null;
31
+ @if $res {
32
+ $r: -#{$res};
33
+ }
34
+ @each $direction in $bm-directions {
35
+ @if $direction == all {
36
+ .#{$t}#{$r}-#{$value} {
37
+ @include direction-expressions($type, $direction, $value);
38
+ }
39
+ } @else {
40
+ $d: str-slice($direction, 0, 1);
41
+ .#{$t}-#{$d}#{$r}-#{$value} {
42
+ @include direction-expressions($type, $direction, $value);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ @mixin disabling-classes($type, $res: null) {
50
+ $value: 0;
51
+ $t: str-slice($type, 0, 1);
52
+ $r: null;
53
+ @if $res {
54
+ $r: -#{$res};
55
+ }
56
+ @each $direction in $bm-directions {
57
+ $d: str-slice($direction, 0, 1);
58
+ .n-#{$t}-#{$d}#{$r},
59
+ .#{$t}-#{$d}#{$r}-#{$value} {
60
+ @include direction-expressions($type, $direction, $value);
61
+ }
62
+ }
63
+ }
64
+
65
+ @mixin position-classes($value, $res: null) {
66
+ $directions: top, right, bottom, left;
67
+ $v: null;
68
+ $r: null;
69
+ @if $value != 0 {
70
+ $v: $value * 1px;
71
+ }
72
+ @if $res {
73
+ $r: -#{$res};
74
+ }
75
+ @each $direction in $directions {
76
+ $d: str-slice($direction, 0, 1);
77
+ .p#{$d}#{$r}-#{$value} {
78
+ #{$direction}: $v !important;
79
+ }
80
+ }
81
+ }
82
+
83
+ @mixin dimension-classes($value, $res: null) {
84
+ @if $value > 0 {
85
+ $r: null;
86
+ @if $res {
87
+ $r: -#{$res};
88
+ }
89
+ .w#{$r}-#{$value} {
90
+ width: $value * 1px !important;
91
+ }
92
+ .h#{$r}-#{$value} {
93
+ height: $value * 1px !important;
94
+ }
95
+ }
96
+ }
97
+
98
+ @mixin print-classes($type, $value, $res: null) {
99
+ @if $type == position {
100
+ @include position-classes($value, $res);
101
+ } @else if $type == dimension {
102
+ @include dimension-classes($value, $res);
103
+ } @else {
104
+ @include direction-classes($type, $value, $res);
105
+ }
106
+ }
107
+
108
+ @mixin main-classes($type, $res: null) {
109
+ @if $bm-values {
110
+ @each $value in $bm-values {
111
+ @include print-classes($type, $value, $res);
112
+ }
113
+ } @else {
114
+ $value: $bm-min-value;
115
+ @while $value < $bm-max-value {
116
+ @include print-classes($type, $value, $res);
117
+ $value: $value + $bm-step;
118
+ }
119
+ @include print-classes($type, $value, $res);
120
+ }
121
+ }
122
+
123
+ @mixin all-disabling-classes($res: null) {
124
+ $r: null;
125
+ @if $res {
126
+ $r: -#{$res};
127
+ }
128
+ // positions
129
+ @if $bm-positions {
130
+ .n-pt#{$r},
131
+ .pt#{$r}-0 {
132
+ top: 0 !important;
133
+ }
134
+
135
+ .n-pr#{$r},
136
+ .pr#{$r}-0 {
137
+ right: 0 !important;
138
+ }
139
+
140
+ .n-pb#{$r},
141
+ .pb#{$r}-0 {
142
+ bottom: 0 !important;
143
+ }
144
+
145
+ .n-pl#{$r},
146
+ .pl#{$r}-0 {
147
+ left: 0 !important;
148
+ }
149
+ }
150
+
151
+ // margins
152
+ @if $bm-margins {
153
+ .n-m#{$r},
154
+ .m#{$r}-0 {
155
+ margin: 0 !important;
156
+ }
157
+
158
+ @include disabling-classes(margin, $res);
159
+ }
160
+
161
+ // borders
162
+ @if $bm-borders {
163
+ .n-b#{$r},
164
+ .b#{$r}-0 {
165
+ border-width: 0 !important;
166
+ }
167
+
168
+ @include disabling-classes(border, $res);
169
+ }
170
+
171
+ // paddings
172
+ @if $bm-paddings {
173
+ .n-p#{$r},
174
+ .p#{$r}-0 {
175
+ padding: 0 !important;
176
+ }
177
+
178
+ @include disabling-classes(padding, $res);
179
+ }
180
+
181
+ // dimensions
182
+ @if $bm-dimensions {
183
+ .n-w#{$r},
184
+ .w#{$r}-0 {
185
+ width: 0 !important;
186
+ }
187
+
188
+ .n-h#{$r},
189
+ .h#{$r}-0 {
190
+ height: 0 !important;
191
+ }
192
+ }
193
+ }
194
+
195
+ @mixin all-main-classes($res: null) {
196
+ // positions
197
+ @if $bm-positions {
198
+ @include main-classes(position, $res);
199
+ }
200
+
201
+ // margins
202
+ @if $bm-margins {
203
+ @include main-classes(margin, $res);
204
+ }
205
+
206
+ // borders
207
+ @if $bm-borders {
208
+ @include main-classes(border, $res);
209
+ }
210
+
211
+ // paddings
212
+ @if $bm-paddings {
213
+ @include main-classes(padding, $res);
214
+ }
215
+
216
+ // dimensions
217
+ @if $bm-dimensions {
218
+ @include main-classes(dimension, $res);
219
+ }
220
+ }
@@ -0,0 +1,25 @@
1
+ //----------------------------------------------------------------------------//
2
+ // BOXMODEL2 > RESPONSIVE_CLASSES---------------------------------------------//
3
+ //----------------------------------------------------------------------------//
4
+
5
+ @if $bm-responsive {
6
+ @media (max-width: $bm-screen-xs-max) {
7
+ @include all-disabling-classes(xs);
8
+ @include all-main-classes(xs);
9
+ }
10
+
11
+ @media (min-width: $bm-screen-sm-min) and (max-width: $bm-screen-sm-max) {
12
+ @include all-disabling-classes(sm);
13
+ @include all-main-classes(sm);
14
+ }
15
+
16
+ @media (min-width: $bm-screen-md-min) and (max-width: $bm-screen-md-max) {
17
+ @include all-disabling-classes(md);
18
+ @include all-main-classes(md);
19
+ }
20
+
21
+ @media (min-width: $bm-screen-lg-min) {
22
+ @include all-disabling-classes(lg);
23
+ @include all-main-classes(lg);
24
+ }
25
+ }
@@ -0,0 +1,23 @@
1
+ //----------------------------------------------------------------------------//
2
+ // BOXMODEL2 > VARS ----------------------------------------------------------//
3
+ //----------------------------------------------------------------------------//
4
+
5
+ $bm-values: null !default;
6
+ $bm-min-value: 5 !default;
7
+ $bm-max-value: 30 !default;
8
+ $bm-step: 5 !default;
9
+ $bm-directions: top, right, bottom, left, horizontal, vertical, all !default;
10
+
11
+ $bm-positions: false !default;
12
+ $bm-margins: true !default;
13
+ $bm-borders: false !default;
14
+ $bm-paddings: true !default;
15
+ $bm-dimensions: false !default;
16
+ $bm-responsive: false !default;
17
+
18
+ $bm-screen-sm-min: 768px !default;
19
+ $bm-screen-md-min: 992px !default;
20
+ $bm-screen-lg-min: 1200px !default;
21
+ $bm-screen-xs-max: ($bm-screen-sm-min - 1) !default;
22
+ $bm-screen-sm-max: ($bm-screen-md-min - 1) !default;
23
+ $bm-screen-md-max: ($bm-screen-lg-min - 1) !default;
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: boxmodel2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Paweł Rosa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.4'
27
+ description: Boxmodel2 is css library providing css classes to modify margins, paddings,
28
+ borders, dimensions and positions without writing css declarations by yourself.
29
+ email: pawel.t.rosa@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - LICENSE
36
+ - README.md
37
+ - boxmodel2.gemspec
38
+ - lib/boxmodel2/version.rb
39
+ - vendor/assets/stylesheets/boxmodel2.scss
40
+ - vendor/assets/stylesheets/boxmodel2/_disabling_classes.scss
41
+ - vendor/assets/stylesheets/boxmodel2/_main_classes.scss
42
+ - vendor/assets/stylesheets/boxmodel2/_mixins.scss
43
+ - vendor/assets/stylesheets/boxmodel2/_responsive_classes.scss
44
+ - vendor/assets/stylesheets/boxmodel2/_vars.scss
45
+ homepage: https://github.com/pawelrosa/boxmodel2
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.4.6
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Boxmodel2, css classes modifying box model
69
+ test_files: []