Browse Source

working ratios

master
j 5 years ago
parent
commit
308710ed05
14 changed files with 333 additions and 141 deletions
  1. 1
    0
      .gitignore
  2. 60
    0
      _variables.sss
  3. 4
    0
      import.css
  4. 0
    6
      index.js
  5. 207
    42
      partials/_helpers.sss
  6. 0
    27
      partials/_layout.sss
  7. 13
    0
      partials/_ratios.sss
  8. 9
    12
      partials/_reset.sss
  9. 0
    0
      partials/_scale.sss
  10. 0
    4
      partials/_selectors.sss
  11. 23
    8
      partials/_typography.sss
  12. 0
    13
      style.sss
  13. 16
    0
      theme.sss
  14. 0
    29
      variables.sss

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+.DS_STORE

+ 60
- 0
_variables.sss View File

@@ -0,0 +1,60 @@
1
+@import './partials/_ratios.sss'
2
+
3
+/**
4
+  * Misc
5
+  */
6
+$transition: 300ms
7
+
8
+/**
9
+  * Page
10
+  */
11
+$max-width: 80vw
12
+
13
+
14
+/**
15
+  * Fonts
16
+  */
17
+$sans: 'helvetica', 'calibri', 'sans-serif'
18
+$serif: 'georgia', 'serif'
19
+$mono: 'input', 'consolas','monospace'
20
+
21
+
22
+/**
23
+  * Modular Scale
24
+  */
25
+$base: 0.5em
26
+$scale: $golden
27
+
28
+$ms-0: calc($base)
29
+$ms-1: calc($ms-0 * $scale)
30
+$ms-2: calc($ms-1 * $scale)
31
+$ms-3: calc($ms-2 * $scale)
32
+$ms-4: calc($ms-3 * $scale)
33
+$ms-5: calc($ms-4 * $scale)
34
+$ms-6: calc($ms-5 * $scale)
35
+$ms-7: calc($ms-6 * $scale)
36
+$ms-8: calc($ms-7 * $scale)
37
+$ms-9: calc($ms-8 * $scale)
38
+
39
+/**
40
+  * Color Scale
41
+  */
42
+$cbase: 0.5
43
+$cs-0: calc($cbase)
44
+$cs-1: calc($cs-0 * $scale)
45
+$cs-2: calc($cs-1 * $scale)
46
+$cs-3: calc($cs-2 * $scale)
47
+$cs-4: calc($cs-3 * $scale)
48
+$cs-5: calc($cs-4 * $scale)
49
+
50
+
51
+/** 
52
+  * Named Breakpoints
53
+  */
54
+@custom-media --tiny-viewport (min-width: 375px)
55
+@custom-media --small-viewport (min-width: 480px)
56
+@custom-media --medium-viewport (min-width: 768px)
57
+@custom-media --large-viewport (min-width: 960px)
58
+@custom-media --extra-large-viewport (min-width: 1080px)
59
+@custom-media --huge-viewport (min-width: 1200px)
60
+@custom-media --ultra-viewport (min-width: 1440px)

+ 4
- 0
import.css View File

@@ -0,0 +1,4 @@
1
+@import './partials/_reset.sss'
2
+@import './partials/_ratios.sss'
3
+@import './partials/_helpers.sss'
4
+@import './partials/_typography.sss'

+ 0
- 6
index.js View File

@@ -1,6 +0,0 @@
1
-// Include all your *.sss Sugarss files
2
-import './partials/_reset.sss'
3
-import './partials/_layout.sss'
4
-import './partials/_typography.sss'
5
-import './partials/_selectors.sss'
6
-import './partials/_helpers.sss'

+ 207
- 42
partials/_helpers.sss View File

@@ -1,61 +1,226 @@
1
-/* Helpers */
2
-@import '../variables.sss'
3
-@import '_selectors.sss'
1
+@import '../_variables.sss'
2
+@import '../theme.sss'
4 3
 
5
-:--headings
6
-    color: $color-primary
7
-p
8
-    line-height: 1.5em
9
-
10
-
11
-%flexer
4
+.w
5
+    &-full
6
+        width: 100%
7
+    &-half
8
+        width: 50%
9
+    
10
+/* Flex box  */
11
+%flexy
12 12
     display: flex
13
+    justify-content: center
14
+    align-items: center
13 15
 
14 16
 .f
15 17
     &-row, &-col
16
-        @extend %flexer
18
+        @extend %flexy
19
+        &.start
20
+            align-items: flex-start
21
+            justify-content: flex-start
22
+        &.end 
23
+            align-items: flex-end
24
+            justify-content: flex-end
25
+        &.between
26
+            justify-content: space-between
27
+        &.around
28
+            justify-content: space-around
29
+        &.even
30
+            justify-content: space-evenly
31
+        &.stretch
32
+            align-content: stretch
33
+        &.baseline
34
+            align-items: baseline
35
+        &.stretch
36
+            justify-content: space-stretch
37
+        &.center
38
+            justify-content: center
39
+            align-items: center
40
+
41
+        &.wrap
42
+            flex-wrap: wrap
17 43
     &-row
18 44
         flex-direction: row
19 45
     &-col
20 46
         flex-direction: column
21
-    &-cntr
22
-        justify-content: center
23
-        align-items: center
24 47
     &-grow
25
-        flex-grow: 10
26
-
27
-%borderer
28
-    border-width: 1px 
29
-    border-color: $primary
30
-
48
+        flex-grow: 1
31 49
 
50
+/* Borders */
32 51
 .b
33 52
     &-none
34
-        border-style: none
53
+        border: none
35 54
     &-solid
36
-        @extend %borderer
37
-        border-style: solid
38
-    &-dash
39
-        @extend %borderer
40
-        border-style: dashed
55
+        border: 1px solid $dark
41 56
     &-dot
42
-        @extend %borderer
43
-        border-style: dotted
44
-    &-pill
45
-        border-radius: 999px
46
-    &-rnd
47
-        border-radius: $ms
57
+        border: 1px dotted $dark
58
+    &-solid, &-dot
59
+        &.rounded
60
+            border-radius: $ms-0
61
+        &.invert
62
+            border-color: $light
48 63
 
49
-.p
50
-    &-all
51
-        padding: $ms
52
-    &-horz
53
-        padding-left: $ms
54
-        padding-right: @padding-left
55
-    &-vert
56
-        padding-top: $ms
57
-        padding-bottom: @padding-top
64
+button
65
+    &:hover
66
+        cursor: pointer
67
+        transition: $transition
68
+    &.b
69
+        &-pill
70
+            padding: $ms-1 $ms-0
71
+            line-height: $ms-1
72
+            text-transform: uppercase
58 73
 
74
+/* Backgrounds */
59 75
 .bg
60 76
     &-none
61
-        background: none
77
+        background-color: none
78
+    &-primary
79
+        background-color: $primary
80
+    &-dark
81
+        background-color: $dark
82
+    &-light
83
+        background-color: $light
84
+    &-cover
85
+        background-size: cover
86
+    &-contain
87
+        background-size: contain
88
+    &-repeat
89
+        background-repeat: repeat
90
+
91
+/* Colors */
92
+.primary
93
+    color: $primary
94
+.dark
95
+    color: $dark
96
+.light
97
+    color: $light
98
+
99
+/* Padding */
100
+.p
101
+    &-none
102
+        padding: none
103
+    &-0
104
+        padding: $ms-0
105
+    &-1
106
+        padding: $ms-1
107
+    &-2
108
+        padding: $ms-2
109
+    &h
110
+        &-0
111
+            padding: 0 $ms-0
112
+        &-1
113
+            padding: 0 $ms-1
114
+        &-2
115
+            padding: 0 $ms-2
116
+    &v
117
+        &-0
118
+            padding: $ms-0 0
119
+        &-1
120
+            padding: $ms-1 0
121
+        &-2
122
+            padding: $ms-2 0
123
+    &t
124
+        &-0
125
+            padding-top: $ms-0
126
+        &-1
127
+            padding-top: $ms-1
128
+        &-2
129
+            padding-top: $ms-2
130
+    &b
131
+        &-0
132
+            padding-bottom: $ms-0
133
+        &-1
134
+            padding-bottom: $ms-1
135
+        &-2
136
+            padding-bottom: $ms-2
137
+    &l
138
+        &-0
139
+            padding-left: $ms-0
140
+        &-1
141
+            padding-left: $ms-1
142
+        &-2
143
+            padding-left: $ms-2
144
+    &r
145
+        &-0
146
+            padding-right: $ms-0
147
+        &-1
148
+            padding-right: $ms-1
149
+        &-2
150
+            padding-right: $ms-2
151
+
152
+/* Margin */
153
+.m
154
+    &-none
155
+        margin: none
156
+    &-0
157
+        margin: $ms-0
158
+    &-1
159
+        margin: $ms-1
160
+    &-2
161
+        margin: $ms-2
162
+    &h
163
+        &-0
164
+            margin: 0 $ms-0
165
+        &-1
166
+            margin: 0 $ms-1
167
+        &-2
168
+            margin: 0 $ms-2
169
+    &v
170
+        &-0
171
+            margin: $ms-0 0
172
+        &-1
173
+            margin: $ms-1 0
174
+        &-2
175
+            margin: $ms-2 0
176
+    &t
177
+        &-0
178
+            margin-top: $ms-0
179
+        &-1
180
+            margin-top: $ms-1
181
+        &-2
182
+            margin-top: $ms-2
183
+    &b
184
+        &-0
185
+            margin-bottom: $ms-0
186
+        &-1
187
+            margin-bottom: $ms-1
188
+        &-2
189
+            margin-bottom: $ms-2
190
+    &l
191
+        &-0
192
+            margin-left: $ms-0
193
+        &-1
194
+            margin-left: $ms-1
195
+        &-2
196
+            margin-left: $ms-2
197
+    &r
198
+        &-0
199
+            margin-right: $ms-0
200
+        &-1
201
+            margin-right: $ms-1
202
+        &-2
203
+            margin-right: $ms-2
204
+
205
+.z
206
+    &-bottom
207
+        position: relative
208
+        z-index: -1
209
+    &-10
210
+        position: relative
211
+        z-index: 10
212
+    &-20
213
+        position: relative
214
+        z-index: 20
215
+    &-30
216
+        position: relative
217
+        z-index: 30
218
+    &-40
219
+        position: relative
220
+        z-index: 40
221
+    &-50
222
+        position: relative
223
+        z-index: 50
224
+    &-top
225
+        position: relative
226
+        z-index: 10001

+ 0
- 27
partials/_layout.sss View File

@@ -1,27 +0,0 @@
1
-/* Layout */
2
-@import '../variables.sss'
3
-
4
-nav, nav > ul, nav > ul li, body > header, body > main, footer, footer > ul
5
-    display: flex
6
-    justify-content: center
7
-    position: relative
8
-    z-index: $zcontent
9
-
10
-._maxwidth
11
-    width: 480px
12
-
13
-@media (min-width: 768px)
14
-    ._maxwidth
15
-        width: 600px
16
-
17
-@media (min-width: 1080px)
18
-    ._maxwidth
19
-        width: 960px
20
-
21
-@media (min-width: 1200px)
22
-    ._maxwidth
23
-        width: 1080px
24
-
25
-@media (min-width: 1920px)
26
-    ._maxwidth
27
-        width: $maxwidth

+ 13
- 0
partials/_ratios.sss View File

@@ -0,0 +1,13 @@
1
+$minor-second: 1.067
2
+$major-second: 1.125
3
+$minor-third: 1.2
4
+$major-third: 1.25
5
+$perfect-fourth: 1.333
6
+$augmented-fourth: 1.414
7
+$perfect-fifth: 1.5
8
+$minor-sixth: 1.6
9
+$golden: 1.618
10
+$major-sixth: 1.667
11
+$minor-seventh: 1.778
12
+$major-seventh: 1.875
13
+$octave: 2

+ 9
- 12
partials/_reset.sss View File

@@ -1,4 +1,6 @@
1
-// Kill margins and paddings; add border-box
1
+@import '../_variables.sss'
2
+@import '../theme.sss'
3
+
2 4
 *
3 5
     margin: 0
4 6
     padding: 0
@@ -6,7 +8,7 @@
6 8
     &:before, &:after
7 9
         background-repeat: no-repeat
8 10
         box-sizing: inherit
9
-    &:focus
11
+    $:focus
10 12
         outline: none !important
11 13
 
12 14
 ::before, ::after
@@ -16,28 +18,23 @@
16 18
 html
17 19
     cursor: default
18 20
     font-family: system-ui
19
-    line-height: 1.15
21
+    line-height: $ms-0
20 22
     tab-size: 4
21 23
 
22
-// Always set color/background/font-size on root
23 24
 body
24 25
     margin: 0
25
-    color: $primary
26
-    font-size: $ms
27
-    font-family: Helvetica, Arial, sans-serif
26
+    font-size: $ms-1
27
+    font-family: $sans
28 28
 
29
-// Remove list-style in navigation tags
30 29
 nav
31 30
     ol, ul
32 31
         list-style: none
33 32
 
34
-// Useful for single page apps to use up all available space
33
+// Good for SPAs
35 34
 html, body
36 35
     height: 100%
37 36
 
38
-// Reset some other default styles
39 37
 button, input, select, textarea
40 38
     font-family: inherit
41 39
     font-size: inherit
42
-    line-height: inherit
43
-
40
+    line-height: inherit

+ 0
- 0
partials/_scale.sss View File


+ 0
- 4
partials/_selectors.sss View File

@@ -1,4 +0,0 @@
1
-@custom-selector :--headings h1, h2, h3, h4, h5, h6
2
-
3
---ms-bases: 1, 0.75
4
---ms-ratios: 2

+ 23
- 8
partials/_typography.sss View File

@@ -1,17 +1,32 @@
1
-@import '../variables.sss'
1
+@import '../_variables.sss'
2
+@import '../theme.sss'
2 3
 
3
-:--headings
4
-    color: $primary
4
+h1
5
+    font-size: $ms-5
6
+    line-height: $ms-4
7
+h2
8
+    font-size: $ms-3
9
+    line-height: $ms-2
10
+h3
11
+    font-size: $ms-2
12
+    line-height: $ms-1
13
+h4
14
+    font-size: $ms-1
15
+    line-height: $ms-0
16
+p
17
+    font-size: $ms-1
18
+    line-height: $ms-0
5 19
 
6 20
 .t
7
-    &-cntr
21
+    &-center
22
+        width: 100%
8 23
         text-align: center
24
+    &-right
25
+        width: 100%
26
+        text-align: right
9 27
     &-left
28
+        width: 100%
10 29
         text-align: left
11
-    &-b
12
-        text-weight: bold
13
-    &-i
14
-        text-style: italic
15 30
     &-up
16 31
         text-transform: uppercase
17 32
     &-cap

+ 0
- 13
style.sss View File

@@ -1,13 +0,0 @@
1
-@import './partials/_reset.sss'
2
-@import './variables.sss'
3
-@import './partials/_layout.sss'
4
-@import './partials/_helpers.sss'
5
-@import './partials/_selectors.sss'
6
-
7
-html
8
-    background-color: $primary
9
-    
10
-body
11
-    display: flex
12
-    flex-direction: column
13
-

+ 16
- 0
theme.sss View File

@@ -0,0 +1,16 @@
1
+@import './_variables.sss'
2
+
3
+/**
4
+  * Colors
5
+*/
6
+$hue: 200
7
+$bg: calc($hue * $cs-1)
8
+$bright: 50%
9
+$opacity: 1
10
+
11
+$primary: hsla($hue, 20%, calc($bright * $cs-1), $opacity)
12
+$secondary: hsla($bg, 20%, calc($bright * $cs-1), $opacity)
13
+$hilite: hsla($hue, 50%, calc($bright * $cs-0), $opacity)
14
+
15
+$light: hsla(255, 50%, calc($bright * $cs-0), $opacity)
16
+$dark: hsla(001, 50%, calc($bright * $cs-0), $opacity)

+ 0
- 29
variables.sss View File

@@ -1,29 +0,0 @@
1
-// Colors
2
-$blue: #0076A3
3
-$chart-bg: rgba(20,20,20)
4
-$background: #444
5
-$background-light: #505050
6
-$dark: #3F3F3F
7
-$darker: #383838
8
-$light: #BBBBBB
9
-$lighter: #CCCCCC
10
-$primary: #008462
11
-$primary-light: #00D6A3
12
-$primary-lighter: #CEFFF3
13
-$primary-dark: #007351
14
-
15
-// Fonts
16
-$sans: 'sans-serif'
17
-$serif: 'serif'
18
-$mono: 'monospace'
19
-
20
-// Proportion (to be replaced with modular scale)
21
-$ms: 0.5em
22
-
23
-// Circles for add page
24
-$radius: 2.5vw
25
-$path: 4px
26
-
27
-$transition: 300ms
28
-
29
-

Loading…
Cancel
Save