flex_classes 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b724fbaa7891b62439196479a3b6a90d83dc0fd
4
- data.tar.gz: 0cc5738a991339cc56e24025354aa04af79daca8
3
+ metadata.gz: 938abf59d57c97f4e7465f4359d509d79a3db629
4
+ data.tar.gz: '096335e1288a37abf283007879b5a3e3b823439e'
5
5
  SHA512:
6
- metadata.gz: e2d9ebc3ef0ce5e916f5440046c7e85df03038a1f5710f427c02f17bc28f890f3cda95affa8dde5214ce0f0f98af7442efd6d29dd0a1e7cddf39522c1285a351
7
- data.tar.gz: 29a3632436f789c1c6d335665faca207a80f61715c35f27aa8e6335d2812ff128166a8908f616ad5842e134ffecf41d7fb71a363876975eea3a8ce6aa96bc26d
6
+ metadata.gz: 902e5655eaf10318708b7108b9882e39979a988f70c098a40bce260d92830c22918e787fcc26dee979d5e365a9e4af12590d0efdcff5ab7aaad2d736d85f3eef
7
+ data.tar.gz: 2912f19c250fa017c8f9ed296b0468beb76d8bc1c1af9fabdc34c41905d10011755ef2bfc0d0555f571dfeeef6555e908086c80b07d02096acd5af3a4f7f3ea7
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.2.0] - 2018-06-06
8
+ ### added
9
+ - variables for setting values in app stylesheet
10
+ - readme
11
+ - changelog
12
+
13
+
14
+ ## [0.1.1] - 2018-06-05
15
+ ### added
16
+ - bug-fix in initialization in rails app tree
17
+
18
+
19
+ ## [0.1.0] - 2018-06-04
20
+ ### added
21
+ - base code and features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flex_classes (0.1.0)
4
+ flex_classes (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # FlexClasses
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/flex_classes`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem provides set of CSS classes which adds related CSS properties to dom element
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,16 +18,97 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install flex_classes
22
20
 
21
+ After it import 'flex_classes' into your sass stylesheet
22
+
23
+ ```sass
24
+ @import 'flex_classes'
25
+ ```
26
+
23
27
  ## Usage
24
28
 
25
- TODO: Write usage instructions here
29
+ ### align child nodes at middle
30
+ ```html
31
+ <div class="flex row middle">
32
+ ```
33
+
34
+ ```haml
35
+ .flex.row.middle
36
+ ```
37
+
38
+ ### add vertical margins, allow wrap, align child nodes at center middle with margins
39
+ ```haml
40
+ .flex.row.center.middle.m-v.childs-m.can-wrap
41
+ ```
42
+
43
+
44
+ ## List all classes
45
+
46
+ ### base
47
+ class | description
48
+ --- | ---
49
+ flex | display: flex; and allow to use all other classes
50
+ row | flex-direction: row
51
+ col | flex-direction: column
52
+
53
+
54
+ ### align
55
+ These classes works only with "row" or "col" class.
56
+ Distribute content of flex col/row at middle/center/bottom/top of container frame.
57
+
58
+ class | description
59
+ --- | ---
60
+ center | same as "text-align: center": "justify-content: center" for rows and "align-items: center" for cols
61
+ middle | same as "vertical-align: middle": "align-items: center" for rows and "justify-content: center" for cols
62
+ top | "align-items: flex-start" for rows and "justify-content: flex-start" for cols
63
+ bottom | "align-items: flex-end" for rows and "justify-content: flex-end" for cols
64
+ stretch | full width for flex-col and full height for flex-row
65
+
66
+
67
+ ### margins
68
+ class | description
69
+ --- | ---
70
+ m | all sides
71
+ m-v | vertical
72
+ m-h | horizontal
73
+ m-top | only top
74
+ m-bottom | only bottom
75
+
76
+
77
+ ### margins for child nodes
78
+ class | description
79
+ --- | ---
80
+ childs-m | all sides
81
+ childs-m-h | horizontal for children
82
+ childs-m-v | vertical for children
83
+
84
+
85
+ ### paddings
86
+ class | description
87
+ --- | ---
88
+ p | all sides
89
+ p-v | vertical
90
+ p-h | horizontal
91
+ p-top | only top
92
+ p-bottom | only bottom
93
+
94
+
95
+ ### other
96
+ class | description
97
+ --- | ---
98
+ can-wrap | flex-wrap: wrap
99
+ space-between | justify-content: space-between
100
+ eq-childs | element > * { flex: 1 1; }
101
+
26
102
 
27
- ## Development
103
+ ## Customizing values of margin and padding
104
+ You can set next variables in your app stylesheet before @import 'flex_classes':
28
105
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
106
+ + $flex-classes-margin-vertical: 6px
107
+ + $flex-classes-margin-horizontal: 10px
108
+ + $flex-classes-padding-vertical: 6px
109
+ + $flex-classes-padding-vertical: 10px
30
110
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
111
 
33
112
  ## Contributing
34
113
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/flex_classes.
114
+ Bug reports and pull requests are welcome on GitHub at https://github.com/smolovsky/flex_classes
@@ -1,17 +1,26 @@
1
1
  // MIT License
2
2
  // Copyright (c) 2018 Kiryl Smalouski
3
3
 
4
+
5
+ // allow set values in app.
6
+ // require @import instead require in app-stylesheet
7
+ $flex-classes-margin-vertical: 6px !default
8
+ $flex-classes-margin-horizontal: 10px !default
9
+
10
+ $flex-classes-padding-vertical: 6px !default
11
+ $flex-classes-padding-vertical: 10px !default
12
+
4
13
  .flex
5
14
  display: flex
6
15
  box-sizing: border-box
7
16
 
8
- $def-m-h: 10px
9
- $def-m-v: 6px
10
- $def-m: $def-m-v $def-m-h
17
+ $fc-m-h: 10px
18
+ $fc-m-v: 6px
19
+ $fc-m: $fc-m-v $fc-m-h
11
20
 
12
- $def-p-h: 10px
13
- $def-p-v: 6px
14
- $def-p: $def-p-v $def-p-h
21
+ $fc-p-h: 10px
22
+ $fc-p-v: 6px
23
+ $fc-p: $fc-p-v $fc-p-h
15
24
 
16
25
 
17
26
  &.row
@@ -23,20 +32,15 @@
23
32
  &.middle
24
33
  align-items: center
25
34
 
26
- &.bottom
27
- align-items: flex-end
28
-
29
35
  &.top
30
36
  align-items: flex-start
31
37
 
38
+ &.bottom
39
+ align-items: flex-end
40
+
32
41
  &.stretch
33
42
  align-items: stretch
34
43
 
35
- &.childs-m
36
- & > *
37
- margin: $def-m
38
-
39
-
40
44
  &.col
41
45
  flex-direction: column
42
46
 
@@ -46,19 +50,15 @@
46
50
  &.middle
47
51
  justify-content: center
48
52
 
49
- &.bottom
50
- justify-content: flex-end
51
-
52
53
  &.top
53
54
  justify-content: flex-start
54
55
 
56
+ &.bottom
57
+ justify-content: flex-end
58
+
55
59
  &.stretch
56
60
  align-items: stretch
57
61
 
58
- &.childs-m
59
- & > *
60
- margin: $def-m
61
-
62
62
 
63
63
  &.space-between
64
64
  justify-content: space-between
@@ -75,53 +75,57 @@
75
75
  // margins
76
76
  // ------------------------
77
77
  &.m
78
- margin: $def-m
78
+ margin: $fc-m
79
79
 
80
80
  &.m-v
81
- margin-top: $def-m-v
82
- margin-bottom: $def-m-v
81
+ margin-top: $fc-m-v
82
+ margin-bottom: $fc-m-v
83
83
 
84
84
  &.m-h
85
- margin-left: $def-m-h
86
- margin-right: $def-m-h
85
+ margin-left: $fc-m-h
86
+ margin-right: $fc-m-h
87
87
 
88
88
 
89
89
  &.m-top
90
- margin-top: $def-m-v
90
+ margin-top: $fc-m-v
91
91
 
92
92
  &.m-bottom
93
- margin-bottom: $def-m-v
93
+ margin-bottom: $fc-m-v
94
+
95
+ &.childs-m
96
+ & > *
97
+ margin: $fc-m
94
98
 
95
99
  &.childs-m-h
96
100
  & > *
97
- margin-left: $def-m-h
98
- margin-right: $def-m-h
101
+ margin-left: $fc-m-h
102
+ margin-right: $fc-m-h
99
103
 
100
104
  &.childs-m-v
101
105
  & > *
102
- margin-top: $def-m-v
103
- margin-bottom: $def-m-v
106
+ margin-top: $fc-m-v
107
+ margin-bottom: $fc-m-v
104
108
 
105
109
 
106
110
  // ------------------------
107
111
  // paddings
108
112
  // ------------------------
109
113
  &.p
110
- padding: $def-p
114
+ padding: $fc-p
111
115
 
112
116
  &.p-top
113
- padding-top: $def-p-v
117
+ padding-top: $fc-p-v
114
118
 
115
119
  &.p-bottom
116
- padding-bottom: $def-p-v
120
+ padding-bottom: $fc-p-v
117
121
 
118
122
  &.p-v
119
- padding-top: $def-p-v
120
- padding-bottom: $def-p-v
123
+ padding-top: $fc-p-v
124
+ padding-bottom: $fc-p-v
121
125
 
122
126
  &.p-h
123
- padding-left: $def-p-h
124
- padding-right: $def-p-h
127
+ padding-left: $fc-p-h
128
+ padding-right: $fc-p-h
125
129
 
126
130
 
127
131
 
@@ -1,3 +1,3 @@
1
1
  module FlexClasses
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flex_classes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiryl Smalouski
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
+ - CHANGELOG.md
49
50
  - Gemfile
50
51
  - Gemfile.lock
51
52
  - LICENSE