codefabrik-styleguide 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26bf608849bfd722a0c3fae256b5338da0863ea20e36fb99df640653a7a5c5a9
4
- data.tar.gz: aea5c73a0fc766affbd06c3fc657a253050a01284a2decfd7bb6389b81e2f862
3
+ metadata.gz: b52da933d4763fbb6ff2dc987d5a66c0cc06a7a7ab64db18155a763395946c09
4
+ data.tar.gz: de5084924f8be9a9c56e1b752d2b26cd8587245e1b7ee79e0e6925cbb5f6dde0
5
5
  SHA512:
6
- metadata.gz: 0e2fd0e3c0a35914252e2c477103e827cc41c22014703769d6d8b866b3b3dffbfbd895bbb1c689608b33b0bd31b9cbf50307f54a5d5303e4f1eedd3442a8aba3
7
- data.tar.gz: 319470299a08db00b427fb91b2ed34a84dcf0c9f27ee5cf1fbf39c76863c086e0aa500b271df98b2b3f773b0ad3da83eb190189aca5d86865949ec863b1bd349
6
+ metadata.gz: cccd51013efb76e3090331cc61027384df77c4f36a4564efb1ea2751240d38da540c03518404ae5836c8a0f7fef6dcf9a9215f66f4e81975eef9a2e0ee9f74cd
7
+ data.tar.gz: c4a86b37bd468a705948f75c0f754d17c8d601448e6ef7443b980e5698075c725c69eac95f777370977b3afa144618d020a3ad627aa9db9cce2b639c60e7e27b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codefabrik-styleguide (0.1.0)
4
+ codefabrik-styleguide (0.1.1)
5
5
  dartsass-rails (>= 0.4.0)
6
6
  rails (>= 6.0)
7
7
 
data/README.md CHANGED
@@ -37,6 +37,8 @@ $secondary_color: pink;
37
37
  $text_on_secondary_color: black;
38
38
  $border_color: green;
39
39
  $default_distance: 1rem;
40
+ $background_color: white;
41
+ $font: 'sans-serif';
40
42
  ```
41
43
 
42
44
  ## Architecture
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Codefabrik
4
4
  module Styleguide
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -1,6 +1,38 @@
1
+ header {
2
+ width: 100%;
3
+ background-color: $primary_color_light;
4
+ color: $text_on_primary_color;
5
+ padding: $default_distance;
6
+
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-items: center;
10
+
11
+ .logo {
12
+ height: 3rem;
13
+ }
14
+
15
+ section, nav {
16
+ margin-bottom: $default_distance;
17
+ text-align: center;
18
+ }
19
+
20
+ nav {
21
+ display: flex;
22
+
23
+ a {
24
+ margin-left: $default_distance;
25
+ margin-right: $default_distance;
26
+ color: $text_on_primary_color;
27
+ text-decoration: none;
28
+ }
29
+ }
30
+ }
31
+
1
32
  .wrapper {
2
33
  width: calc(100% - 2 * $default_distance);
3
34
  margin: 0 $default_distance;
35
+ margin-top: $default_distance;
4
36
 
5
37
  @media screen and (min-width: $media_breakpoint) {
6
38
  width: $media_breakpoint;
@@ -8,6 +40,36 @@
8
40
  }
9
41
  }
10
42
 
43
+ // Side by side layout
44
+ @media screen and (min-width: $media_breakpoint) {
45
+ body {
46
+ display: flex;
47
+
48
+ .sidebar {
49
+ width: unset;
50
+ height: 100vh;
51
+ position: sticky;
52
+ top: 0;
53
+ padding: 0;
54
+ padding-top: $default_distance;
55
+
56
+ nav {
57
+ display: flex;
58
+ flex-direction: column;
59
+
60
+ a {
61
+ margin: 0;
62
+ }
63
+ }
64
+ }
65
+
66
+ .wrapper {
67
+ flex: 1;
68
+ margin: 2vh;
69
+ }
70
+ }
71
+ }
72
+
11
73
  $sizes: ("quarter": 0.25, "half": 0.5, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6);
12
74
 
13
75
  @each $name, $size in $sizes {
@@ -4,6 +4,16 @@
4
4
  row-gap: $default_distance;
5
5
  grid-template-columns: 1fr;
6
6
 
7
+ .center-center {
8
+ justify-self: center;
9
+ align-self: center;
10
+ }
11
+
12
+ .center-right {
13
+ justify-self: flex-end;
14
+ align-self: center;
15
+ }
16
+
7
17
  &.nogap {
8
18
  column-gap: 0;
9
19
  row-gap: 0;
@@ -68,6 +78,10 @@ $dir_h: ("left": flex-start, "center": center, "right": flex-end);
68
78
  }
69
79
  }
70
80
 
81
+ &.row {
82
+ flex-direction: row;
83
+ }
84
+
71
85
  &.apart {
72
86
  width: 100%;
73
87
  justify-content: space-between;
@@ -1,12 +1,18 @@
1
+ body {
2
+ font-family: $font;
3
+ }
4
+
1
5
  p {
2
6
  margin-bottom: $default_distance;
3
7
  line-height: 1.6;
4
8
  text-rendering: optimizeLegibility;
9
+ font-size: 1 * $default_distance;
5
10
  }
6
11
 
7
12
  a {
8
13
  line-height: inherit;
9
14
  color: $primary_color;
15
+ font-size: 1 * $default_distance;
10
16
  }
11
17
 
12
18
  h1, h2, h3, h4, h5, h6 {
@@ -6,6 +6,7 @@
6
6
  cursor: pointer;
7
7
  background-color: $primary_color;
8
8
  color: $text_on_primary_color;
9
+ font-size: 0.8 * $default_distance;
9
10
 
10
11
  &:hover {
11
12
  background-color: darken($primary_color, 15%);
@@ -0,0 +1,51 @@
1
+ .table {
2
+ width: 100%;
3
+ display: table;
4
+ border-bottom: 2px solid $primary_color;
5
+ overflow-x: scroll;
6
+
7
+ &:not(:first-child) {
8
+ margin-top: 1rem;
9
+ }
10
+
11
+ .thead {
12
+ display: table-header-group;
13
+ position: sticky;
14
+ top: 0;
15
+ background-color: $primary_color;
16
+
17
+ .tr {
18
+ display: table-row;
19
+
20
+ .th {
21
+ display: table-cell;
22
+ font-weight: 300;
23
+ padding: 1rem;
24
+ text-align: left;
25
+ }
26
+ }
27
+ }
28
+
29
+ .tbody {
30
+ display: table-row-group;
31
+
32
+ .tr {
33
+ display: table-row;
34
+
35
+ &:nth-child(2n+1) {
36
+ background: $background_color;
37
+ }
38
+
39
+ .td {
40
+ display: table-cell;
41
+ padding: 1rem;
42
+ border-right: 2px solid $primary_color;
43
+ vertical-align: middle;
44
+
45
+ &:first-child {
46
+ border-left: 2px solid $primary_color;
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,92 @@
1
+ form .input, form input[type=submit] {
2
+ margin-top: $default_distance;
3
+ margin-bottom: $default_distance;
4
+
5
+ &.hidden {
6
+ margin: 0;
7
+ }
8
+
9
+ input, select {
10
+ padding: 0.5em;
11
+ color: $text_on_primary_color;
12
+ width: 100%;
13
+
14
+ @media screen and (min-width: $media_breakpoint) {
15
+ width: 500px;
16
+ }
17
+ }
18
+
19
+ label:not(.checkbox) {
20
+ display: block;
21
+ font-size: 0.8em;
22
+ }
23
+
24
+ label.checkbox {
25
+ display: flex;
26
+ align-items: center;
27
+
28
+ input {
29
+ margin-right: 0.3em;
30
+ width: unset;
31
+ }
32
+ }
33
+
34
+ span.radio {
35
+ display: flex;
36
+ align-items: center;
37
+
38
+ label {
39
+ font-size: $default_distance;
40
+ }
41
+
42
+ input {
43
+ margin-right: 0.2em;
44
+ }
45
+ }
46
+ }
47
+
48
+ form {
49
+ .links {
50
+ margin-top: 0.5 * $default_distance;
51
+ }
52
+
53
+ trix-editor, .trix-button {
54
+ background-color: $background_color;
55
+ }
56
+
57
+ .nested-fields {
58
+ border: 1px solid $primary_color;
59
+ padding: 0.5 * $default_distance;
60
+ margin-bottom: 0.5 * $default_distance;
61
+
62
+ .input:first-child {
63
+ margin-top: 0;
64
+ }
65
+
66
+ @media screen and (min-width: $media_breakpoint) {
67
+ display: flex;
68
+
69
+ input {
70
+ width: 200px;
71
+ }
72
+ }
73
+ }
74
+
75
+ span.error {
76
+ background-color: $warning_color;
77
+ margin-left: 0.5em;
78
+ padding: 0.3em;
79
+ }
80
+
81
+ p.info {
82
+ &::before {
83
+ margin-right: 0.3em;
84
+ display: inline-block;
85
+ content: '\1f6c8';
86
+ }
87
+ }
88
+ }
89
+
90
+ p + .btn, p + form.button_to, form + form.button_to {
91
+ margin-top: $default_distance;
92
+ }
@@ -5,9 +5,17 @@ $secondary_color: pink !default;
5
5
  $text_on_secondary_color: black !default;
6
6
  $border_color: green !default;
7
7
  $default_distance: 1rem !default;
8
+ $background_color: white !default;
9
+ $font: 'sans-serif' !default;
10
+
11
+ $warning_color: lighten(red, 40%);
12
+
13
+ $primary_color_light: lighten($primary_color, 10%);
8
14
 
9
15
  @import 'styleguide/01_reset';
10
16
  @import 'styleguide/02_layout';
11
17
  @import 'styleguide/03_grid';
12
18
  @import 'styleguide/04_typo';
13
19
  @import 'styleguide/05_buttons';
20
+ @import 'styleguide/06_tables';
21
+ @import 'styleguide/07_forms';
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codefabrik-styleguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-01 00:00:00.000000000 Z
11
+ date: 2023-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dartsass-rails
@@ -62,6 +62,8 @@ files:
62
62
  - vendor/assets/stylesheets/codefabrik/styleguide/03_grid.scss
63
63
  - vendor/assets/stylesheets/codefabrik/styleguide/04_typo.scss
64
64
  - vendor/assets/stylesheets/codefabrik/styleguide/05_buttons.scss
65
+ - vendor/assets/stylesheets/codefabrik/styleguide/06_tables.scss
66
+ - vendor/assets/stylesheets/codefabrik/styleguide/07_forms.scss
65
67
  homepage: https://code-fabrik.ch
66
68
  licenses:
67
69
  - MIT