pallote-css 0.3.12 → 0.4.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.
Files changed (37) hide show
  1. package/dist/pallote.min.css +1 -1
  2. package/dist/pallote.min.css.map +1 -1
  3. package/dist/pallote.scss +37 -31
  4. package/dist/styles/common/_editor.scss +3 -3
  5. package/dist/styles/common/_fontface.scss +2 -2
  6. package/dist/styles/common/_global.scss +3 -3
  7. package/dist/styles/common/_mixins.scss +21 -22
  8. package/dist/styles/common/_reset.scss +2 -2
  9. package/dist/styles/common/_variables.scss +33 -33
  10. package/dist/styles/components/_accordion.scss +6 -7
  11. package/dist/styles/components/_alert.scss +55 -65
  12. package/dist/styles/components/_breadcrumbs.scss +38 -18
  13. package/dist/styles/components/_button.scss +23 -17
  14. package/dist/styles/components/_buttons.scss +2 -2
  15. package/dist/styles/components/_card.scss +134 -86
  16. package/dist/styles/components/_divider.scss +12 -11
  17. package/dist/styles/components/_form.scss +2 -2
  18. package/dist/styles/components/_grid.scss +64 -127
  19. package/dist/styles/components/_input.scss +37 -7
  20. package/dist/styles/components/_link.scss +14 -9
  21. package/dist/styles/components/_list.scss +7 -8
  22. package/dist/styles/components/_nav.scss +3 -3
  23. package/dist/styles/components/_navbar.scss +2 -2
  24. package/dist/styles/components/_section.scss +18 -34
  25. package/dist/styles/components/_sidebar.scss +3 -3
  26. package/dist/styles/components/_snippet.scss +4 -4
  27. package/dist/styles/components/_status.scss +7 -7
  28. package/dist/styles/components/_switch.scss +2 -2
  29. package/dist/styles/components/_table.scss +153 -0
  30. package/dist/styles/components/_tabs.scss +2 -2
  31. package/dist/styles/components/_tag.scss +5 -5
  32. package/dist/styles/utilities/_color.scss +2 -2
  33. package/dist/styles/utilities/_global.scss +2 -2
  34. package/dist/styles/utilities/_grid.scss +124 -0
  35. package/dist/styles/utilities/_layout.scss +127 -0
  36. package/dist/styles/utilities/_text.scss +37 -45
  37. package/package.json +6 -7
@@ -0,0 +1,153 @@
1
+ @use '../common/variables';
2
+ @use '../common/mixins';
3
+ @use '../utilities/text';
4
+
5
+ // —————————————————————————————————————————————————————————————————
6
+ // variables
7
+ // elements
8
+ // striped
9
+ // hasHover
10
+ // dense
11
+ // border
12
+ // kind (for table cell component)
13
+ // —————————————————————————————————————————————————————————————————
14
+
15
+ // —————————————————————————————————————————————————————————————————
16
+ // variables
17
+ // —————————————————————————————————————————————————————————————————
18
+
19
+ $padding-vertical: .5rem;
20
+ $padding-horizontal: .75rem;
21
+ $padding-dense-vertical: .25rem;
22
+ $padding-dense-horizontal: .5rem;
23
+
24
+ // —————————————————————————————————————————————————————————————————
25
+ // elements
26
+ // —————————————————————————————————————————————————————————————————
27
+
28
+ .table {
29
+ width: 100%;
30
+ border-spacing: 0;
31
+ border-collapse: separate;
32
+ overflow: hidden;
33
+ background-color: variables.$background-paper;
34
+
35
+ &_content {
36
+ width: 100%;
37
+ }
38
+
39
+ &_head {
40
+ @extend %caption;
41
+ font-weight: bold;
42
+ color: variables.$text-alt;
43
+ }
44
+
45
+ &_cell {
46
+ padding: $padding-vertical $padding-horizontal;
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+
50
+ .buttons {
51
+ justify-content: flex-end;
52
+ flex-wrap: nowrap;
53
+ }
54
+ }
55
+
56
+ &_footer {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: space-between;
60
+ width: 100%;
61
+ background-color: variables.$overlay;
62
+ padding: $padding-vertical;
63
+ border-top: variables.$border;
64
+ }
65
+
66
+ &_pagination {
67
+ width: fit-content;
68
+ }
69
+
70
+ &_rowSelect {
71
+ width: 5rem;
72
+ margin-bottom: 0;
73
+ }
74
+ }
75
+
76
+ td.table_cell { border-top: variables.$border; }
77
+ th.table_cell { background-color: rgba(variables.$contrast, 0.05); }
78
+
79
+ // —————————————————————————————————————————————————————————————————
80
+ // striped
81
+ // —————————————————————————————————————————————————————————————————
82
+
83
+ .table-striped {
84
+
85
+ .table_row:nth-child(even) {
86
+ background-color: rgba(variables.$contrast, 0.03);
87
+ }
88
+ }
89
+ // —————————————————————————————————————————————————————————————————
90
+ // hasHover
91
+ // —————————————————————————————————————————————————————————————————
92
+
93
+ .table-hasHover {
94
+
95
+ .table {
96
+
97
+ &_head .table_row:hover { background-color: transparent; }
98
+ &_row:hover { background-color: variables.$hover; }
99
+ }
100
+ }
101
+ // —————————————————————————————————————————————————————————————————
102
+ // dense
103
+ // —————————————————————————————————————————————————————————————————
104
+
105
+ .table-dense {
106
+
107
+ .table {
108
+
109
+ &_cell {
110
+ @extend %caption;
111
+ padding: $padding-dense-vertical $padding-dense-horizontal;
112
+ }
113
+
114
+ &_footer {
115
+ padding: $padding-dense-vertical;
116
+ }
117
+ }
118
+
119
+ th.table_cell {
120
+ @extend %overline;
121
+ font-weight: variables.$font-bold;
122
+ }
123
+ }
124
+
125
+ // —————————————————————————————————————————————————————————————————
126
+ // border
127
+ // —————————————————————————————————————————————————————————————————
128
+
129
+ .table-border {
130
+ border: variables.$border;
131
+ border-radius: variables.$border-radius-md;
132
+ }
133
+
134
+ // —————————————————————————————————————————————————————————————————
135
+ // kind (for table cell component)
136
+ // —————————————————————————————————————————————————————————————————
137
+
138
+ .table_cell {
139
+
140
+ &-number {
141
+ text-align: right;
142
+ }
143
+
144
+ &-action {
145
+ text-align: right;
146
+ width: 1%;
147
+ white-space: nowrap;
148
+
149
+ .buttons {
150
+ justify-content: flex-end;
151
+ }
152
+ }
153
+ }
@@ -1,5 +1,5 @@
1
- @use "../common/variables";
2
- @use "../utilities/text";
1
+ @use '../common/variables';
2
+ @use '../utilities/text';
3
3
 
4
4
  // —————————————————————————————————————————————————————————————————
5
5
  // elements
@@ -1,6 +1,6 @@
1
- @use "sass:list";
2
- @use "../common/variables";
3
- @use "../utilities/text";
1
+ @use 'sass:list';
2
+ @use '../common/variables';
3
+ @use '../utilities/text';
4
4
 
5
5
  // —————————————————————————————————————————————————————————————————
6
6
  // elements
@@ -49,7 +49,7 @@
49
49
  // color
50
50
  // —————————————————————————————————————————————————————————————————
51
51
 
52
- @mixin color($prefix, $colors...) {
52
+ @mixin tag-color($prefix, $colors...) {
53
53
 
54
54
  @each $i in $colors {
55
55
  .#{$prefix}#{list.nth($i, 1)} {
@@ -59,7 +59,7 @@
59
59
  }
60
60
  }
61
61
 
62
- @include color('tag',
62
+ @include tag-color('tag',
63
63
  '' variables.$primary variables.$primary-contrast,
64
64
  '-secondary' variables.$secondary variables.$secondary-contrast,
65
65
  '-grey' variables.$text-disabled variables.$text,
@@ -1,5 +1,5 @@
1
- @use "sass:list";
2
- @use "../common/variables";
1
+ @use 'sass:list';
2
+ @use '../common/variables';
3
3
 
4
4
  // —————————————————————————————————————————————————————————————————
5
5
  // fill
@@ -1,5 +1,5 @@
1
- @use "../common/mixins";
2
- @use "../common/variables";
1
+ @use '../common/mixins';
2
+ @use '../common/variables';
3
3
 
4
4
  // —————————————————————————————————————————————————————————————————
5
5
  // responsive
@@ -0,0 +1,124 @@
1
+ @use '../common/mixins';
2
+ @use '../common/variables';
3
+
4
+ // —————————————————————————————————————————————————————————————————
5
+ // elements
6
+ // wrap
7
+ // direction
8
+ // justify
9
+ // items
10
+ // self
11
+ // gap and col
12
+ // —————————————————————————————————————————————————————————————————
13
+
14
+ // —————————————————————————————————————————————————————————————————
15
+ // elements
16
+ // —————————————————————————————————————————————————————————————————
17
+
18
+ .flex {
19
+ display: flex;
20
+ box-sizing: border-box;
21
+ flex-direction: row;
22
+ flex-wrap: wrap;
23
+ }
24
+
25
+ // —————————————————————————————————————————————————————————————————
26
+ // wrap
27
+ // —————————————————————————————————————————————————————————————————
28
+
29
+ // have children wrap automatically
30
+ .flex-wrap {
31
+
32
+ > .flex {
33
+ flex: 1 0 0;
34
+
35
+ > * {
36
+ width: 100%;
37
+ }
38
+ }
39
+ }
40
+
41
+ // —————————————————————————————————————————————————————————————————
42
+ // direction
43
+ // —————————————————————————————————————————————————————————————————
44
+
45
+ .direction-column { flex-direction: column; }
46
+ .direction-columnReverse { flex-direction: column-reverse; }
47
+ .direction-row { flex-direction: row; flex-wrap: wrap; }
48
+ .direction-rowReverse { flex-direction: row-reverse; flex-wrap: wrap; }
49
+
50
+ // —————————————————————————————————————————————————————————————————
51
+ // justify
52
+ // —————————————————————————————————————————————————————————————————
53
+
54
+ .justify-center { justify-content: center;}
55
+ .justify-end { justify-content: flex-end;}
56
+ .justify-start { justify-content: flex-start;}
57
+ .justify-spaceAround { justify-content: space-around;}
58
+ .justify-spaceBetween { justify-content: space-between;}
59
+ .justify-spaceEvenly { justify-content: space-evenly;}
60
+
61
+ // —————————————————————————————————————————————————————————————————
62
+ // items
63
+ // —————————————————————————————————————————————————————————————————
64
+
65
+ .items-stretch { align-items: stretch; }
66
+ .items-center { align-items: center; }
67
+ .items-end { align-items: flex-end; }
68
+ .items-start { align-items: flex-start; }
69
+ .items-baseline { align-items: baseline; }
70
+
71
+ // —————————————————————————————————————————————————————————————————
72
+ // self
73
+ // —————————————————————————————————————————————————————————————————
74
+
75
+ .self-stretch { align-self: stretch; }
76
+ .self-center { align-self: center; }
77
+ .self-end { align-self: flex-end; }
78
+ .self-start { align-self: flex-start; }
79
+ .self-baseline { align-self: baseline; }
80
+
81
+ // —————————————————————————————————————————————————————————————————
82
+ // gap and col
83
+ // —————————————————————————————————————————————————————————————————
84
+
85
+ $columns: 12;
86
+ $breakpoints: (
87
+ xs: mobile-sm,
88
+ sm: mobile,
89
+ md: tablet,
90
+ lg: laptop,
91
+ xl: desktop
92
+ );
93
+
94
+ @for $i from 1 through $columns {
95
+ .col-#{$i} {
96
+ width: variables.$col * $i;
97
+ }
98
+ }
99
+
100
+ [class*="col-"] {
101
+ width: 100%;
102
+ }
103
+
104
+ @for $i from 1 through $columns {
105
+ .gap-#{$i} {
106
+ gap: #{$i * .25}rem;
107
+
108
+ @for $j from 1 through $columns {
109
+ > .col-#{$j} {
110
+ width: calc((variables.$col * $j) - (#{$i * .25}rem * (($columns / $j - 1) / ($columns / $j))));
111
+ }
112
+ }
113
+
114
+ @each $suffix, $breakpoint in $breakpoints {
115
+ @include mixins.responsive(up, $breakpoint) {
116
+ @for $j from 1 through $columns {
117
+ > .col-#{$suffix}-#{$j} {
118
+ width: calc((variables.$col * $j) - (#{$i * .25}rem * (($columns / $j - 1) / ($columns / $j))));
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
@@ -0,0 +1,127 @@
1
+ @use "../common/mixins";
2
+ @use "../common/variables";
3
+
4
+ // —————————————————————————————————————————————————————————————————
5
+ // elements
6
+ // wrap
7
+ // direction
8
+ // justify
9
+ // items
10
+ // self
11
+ // gap and col
12
+ // —————————————————————————————————————————————————————————————————
13
+
14
+ // —————————————————————————————————————————————————————————————————
15
+ // elements
16
+ // —————————————————————————————————————————————————————————————————
17
+
18
+ .flex,
19
+ .flex_item {
20
+ display: flex;
21
+ box-sizing: border-box;
22
+ flex-direction: row;
23
+ flex-wrap: wrap;
24
+ }
25
+
26
+ // —————————————————————————————————————————————————————————————————
27
+ // wrap
28
+ // —————————————————————————————————————————————————————————————————
29
+
30
+ // have children wrap automatically
31
+ .flex-wrap {
32
+ justify-content: center;
33
+
34
+ > .flex_item {
35
+ flex: 1 0 0;
36
+
37
+ > * {
38
+ width: 100%;
39
+ }
40
+ }
41
+ }
42
+
43
+ // —————————————————————————————————————————————————————————————————
44
+ // direction
45
+ // —————————————————————————————————————————————————————————————————
46
+
47
+ .flex-column { flex-direction: column; }
48
+ .flex-columnReverse { flex-direction: column-reverse; }
49
+ .flex-row { flex-direction: row; flex-wrap: wrap; }
50
+ .flex-rowReverse { flex-direction: row-reverse; flex-wrap: wrap; }
51
+
52
+ // —————————————————————————————————————————————————————————————————
53
+ // justify
54
+ // —————————————————————————————————————————————————————————————————
55
+
56
+ .flex-jc-center { justify-content: center;}
57
+ .flex-jc-end { justify-content: flex-end;}
58
+ .flex-jc-start { justify-content: flex-start;}
59
+ .flex-jc-spaceAround { justify-content: space-around;}
60
+ .flex-jc-spaceBetween { justify-content: space-between;}
61
+ .flex-jc-spaceEvenly { justify-content: space-evenly;}
62
+
63
+ // —————————————————————————————————————————————————————————————————
64
+ // items
65
+ // —————————————————————————————————————————————————————————————————
66
+
67
+ .flex-ai-stretch { align-items: stretch; }
68
+ .flex-ai-center { align-items: center; }
69
+ .flex-ai-end { align-items: flex-end; }
70
+ .flex-ai-start { align-items: flex-start; }
71
+ .flex-ai-baseline { align-items: baseline; }
72
+
73
+ // —————————————————————————————————————————————————————————————————
74
+ // self
75
+ // —————————————————————————————————————————————————————————————————
76
+
77
+ .flex-as-stretch { align-self: stretch; }
78
+ .flex-as-center { align-self: center; }
79
+ .flex-as-end { align-self: flex-end; }
80
+ .flex-as-start { align-self: flex-start; }
81
+ .flex-as-baseline { align-self: baseline; }
82
+
83
+ // —————————————————————————————————————————————————————————————————
84
+ // gap and col
85
+ // —————————————————————————————————————————————————————————————————
86
+
87
+ $columns: 12;
88
+ $breakpoints: (
89
+ xs: mobile-sm,
90
+ sm: mobile,
91
+ md: tablet,
92
+ lg: laptop,
93
+ xl: desktop
94
+ );
95
+
96
+ @for $i from 1 through $columns {
97
+ .col-#{$i} {
98
+ width: variables.$col * $i;
99
+ }
100
+ }
101
+
102
+ [class*="gap-"],
103
+ [class*="col-"] {
104
+ width: 100%;
105
+ }
106
+
107
+ @for $i from 1 through $columns {
108
+ .gap-#{$i} {
109
+ gap: #{$i * .25}rem;
110
+
111
+ @for $j from 1 through $columns {
112
+ > .col-#{$j} {
113
+ width: calc((variables.$col * $j) - (#{$i * .25}rem * (($columns / $j - 1) / ($columns / $j))));
114
+ }
115
+ }
116
+
117
+ @each $suffix, $breakpoint in $breakpoints {
118
+ @include mixins.responsive(up, $breakpoint) {
119
+ @for $j from 1 through $columns {
120
+ > .col-#{$suffix}-#{$j} {
121
+ width: calc((variables.$col * $j) - (#{$i * .25}rem * (($columns / $j - 1) / ($columns / $j))));
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
@@ -1,6 +1,6 @@
1
- @use "sass:list";
2
- @use "../common/mixins";
3
- @use "../common/variables";
1
+ @use 'sass:list';
2
+ @use '../common/mixins';
3
+ @use '../common/variables';
4
4
 
5
5
  // —————————————————————————————————————————————————————————————————
6
6
  // elements
@@ -24,6 +24,38 @@
24
24
  line-height: $line-height;
25
25
  }
26
26
 
27
+ .body, %body {
28
+ @include font-size(
29
+ variables.$body-size,
30
+ variables.$body-weight,
31
+ variables.$body-line-height
32
+ );
33
+ }
34
+
35
+ .subtitle, %subtitle {
36
+ @include font-size(
37
+ variables.$subtitle-size,
38
+ variables.$subtitle-weight,
39
+ variables.$subtitle-line-height
40
+ );
41
+ }
42
+
43
+ .caption, %caption {
44
+ @include font-size(
45
+ variables.$caption-size,
46
+ variables.$caption-weight,
47
+ variables.$caption-line-height
48
+ );
49
+ }
50
+
51
+ .overline, %overline {
52
+ @include font-size(
53
+ variables.$overline-size,
54
+ variables.$overline-weight,
55
+ variables.$overline-line-height
56
+ );
57
+ }
58
+
27
59
  .h1, %h1 {
28
60
  @include font-size(
29
61
  variables.$h1-size,
@@ -72,38 +104,6 @@
72
104
  );
73
105
  }
74
106
 
75
- .subtitle, %subtitle {
76
- @include font-size(
77
- variables.$subtitle-size,
78
- variables.$subtitle-weight,
79
- variables.$subtitle-line-height
80
- );
81
- }
82
-
83
- .body, %body {
84
- @include font-size(
85
- variables.$body-size,
86
- variables.$body-weight,
87
- variables.$body-line-height
88
- );
89
- }
90
-
91
- .caption, %caption {
92
- @include font-size(
93
- variables.$caption-size,
94
- variables.$caption-weight,
95
- variables.$caption-line-height
96
- );
97
- }
98
-
99
- .overline, %overline {
100
- @include font-size(
101
- variables.$overline-size,
102
- variables.$overline-weight,
103
- variables.$overline-line-height
104
- );
105
- }
106
-
107
107
  @mixin gutter {
108
108
 
109
109
  & + & {
@@ -170,7 +170,7 @@
170
170
  // color
171
171
  // —————————————————————————————————————————————————————————————————
172
172
 
173
- @mixin color($prefix, $colors...) {
173
+ @mixin text-color($prefix, $colors...) {
174
174
  @each $i in $colors {
175
175
  .#{$prefix}#{list.nth($i, 1)} {
176
176
  color: list.nth($i, 2) !important;
@@ -178,19 +178,11 @@
178
178
  .h1, .h2, .h3, .h4, .h5, .h6 {
179
179
  color: list.nth($i, 2) !important;
180
180
  }
181
-
182
- &.link {
183
- text-decoration: underline rgba(list.nth($i, 2), 0.5);
184
-
185
- @include mixins.hover {
186
- text-decoration: underline 0.125em;
187
- }
188
- }
189
181
  }
190
182
  }
191
183
  }
192
184
 
193
- @include color('text-',
185
+ @include text-color('text-',
194
186
  'default' variables.$text,
195
187
  'alt' variables.$text-alt,
196
188
  'disabled' variables.$text-disabled,
package/package.json CHANGED
@@ -1,18 +1,16 @@
1
1
  {
2
2
  "name": "pallote-css",
3
- "version": "0.3.12",
3
+ "version": "0.4.0",
4
4
  "description": "CSS component library",
5
- "main": "dist/pallote.scss",
5
+ "main": "dist/pallote.min.css",
6
6
  "styles": "dist/pallote.scss",
7
- "files": [
8
- "dist/*"
9
- ],
7
+ "files": ["dist"],
10
8
  "publishConfig": {
11
9
  "directory": "dist"
12
10
  },
13
11
  "scripts": {
14
- "dev": "onchange 'src/styles/**/*.scss' 'src/scripts/**/*.js' -- npm run build",
15
- "build": "npm run build:js && npm run build:css",
12
+ "watch": "onchange 'src/styles/**/*.scss' 'src/scripts/**/*.js' -- npm run build",
13
+ "build": "mkdir -p dist && pnpm build:js && pnpm build:css",
16
14
  "build:assets": "ncp src/assets dist/assets",
17
15
  "build:css": "sass src/pallote.scss dist/pallote.min.css --style=compressed && ncp src/styles dist/styles && ncp src/pallote.scss dist/pallote.scss",
18
16
  "build:js": "uglifyjs src/scripts/*.js -o dist/pallote.min.js"
@@ -28,6 +26,7 @@
28
26
  ],
29
27
  "author": "Nocheke",
30
28
  "license": "ISC",
29
+ "packageManager": "pnpm@10.4.1",
31
30
  "bugs": {
32
31
  "url": "https://github.com/ArnaudDarre/pallote-css/issues"
33
32
  },