compostrap 1.0.4 → 1.1.1

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.
@@ -1,8 +1,8 @@
1
- //
2
- // sidebar skeleton
3
- //
4
-
5
- @use 'body';
6
- @use 'wrapper';
7
- @use 'sidebar';
8
- @use 'theme';
1
+ //
2
+ // sidebar skeleton
3
+ //
4
+
5
+ @use 'body';
6
+ @use 'wrapper';
7
+ @use 'sidebar';
8
+ @use 'theme';
@@ -32,15 +32,6 @@
32
32
  // never underlined, also when the theme (or a project) underlines links on hover
33
33
  &:hover {
34
34
  text-decoration: none;
35
-
36
- // the bell shakes only for a user who has not asked the system for less motion
37
- @media (prefers-reduced-motion: no-preference) {
38
- .bell {
39
- animation: bell-shake .5s cubic-bezier(.36, .07, .19, .97) both;
40
- backface-visibility: hidden;
41
- transform-origin: top right;
42
- }
43
- }
44
35
  }
45
36
  }
46
37
 
@@ -62,18 +53,6 @@
62
53
  padding-left: var.$sm-link-padding-x + var.$sm-icon-width + var.$sm-icon-gap + var.$sm-sub-indent;
63
54
  }
64
55
 
65
- @keyframes bell-shake {
66
- 0% { transform: rotate(0); }
67
- 15% { transform: rotate(5deg); }
68
- 30% { transform: rotate(-5deg); }
69
- 45% { transform: rotate(4deg); }
70
- 60% { transform: rotate(-4deg); }
71
- 75% { transform: rotate(2deg); }
72
- 85% { transform: rotate(-2deg); }
73
- 92% { transform: rotate(1deg); }
74
- 100% { transform: rotate(0); }
75
- }
76
-
77
56
  &-icon {
78
57
  display: inline-block;
79
58
  width: var.$sm-icon-width;
@@ -0,0 +1,158 @@
1
+ //
2
+ // sortable: items of a list moved by a handle of dots (the mouse, a finger or the keyboard), e.g. the order of the
3
+ // menu of the administration, of the photos of a product or of the rows of a list
4
+ //
5
+ // <ul class="list-group sortable" data-sortable-group="menu">
6
+ // <li class="list-group-item sortable-item" data-id="blog.articles">
7
+ // <button type="button" class="sortable-handle" aria-label="Move Articles"></button>
8
+ // …the content of the row
9
+ // </li>
10
+ // </ul>
11
+ //
12
+ // The handle draws its six dots itself (no icon font). The script SortableList moves the items: the item being
13
+ // dragged stays in the list as a tinted place (sortable-placeholder) and a copy follows the pointer
14
+ // (sortable-ghost); an item grabbed by the keyboard is tinted (sortable-grabbed). A list inside an item
15
+ // (sortable-nested) is one level deeper, e.g. the links of a group of the menu; an empty list shows its
16
+ // data-sortable-empty text, so there is a place to drop on.
17
+ //
18
+
19
+ // two columns of three dots
20
+ $-grip: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3e%3cg fill='black'%3e%3ccircle cx='2.5' cy='3' r='1.5'/%3e%3ccircle cx='7.5' cy='3' r='1.5'/%3e%3ccircle cx='2.5' cy='8' r='1.5'/%3e%3ccircle cx='7.5' cy='8' r='1.5'/%3e%3ccircle cx='2.5' cy='13' r='1.5'/%3e%3ccircle cx='7.5' cy='13' r='1.5'/%3e%3c/g%3e%3c/svg%3e");
21
+
22
+ .sortable {
23
+ --sortable-handle-size: 1.75rem;
24
+ --sortable-handle-color: color-mix(in srgb, var(--bs-secondary-color) 70%, transparent);
25
+ --sortable-place-bg: rgba(var(--bs-primary-rgb), .06);
26
+ --sortable-place-line: rgba(var(--bs-primary-rgb), .45);
27
+ --sortable-indent: 2.5rem;
28
+ }
29
+
30
+ .sortable-item {
31
+ display: flex;
32
+ gap: .75rem;
33
+ align-items: center;
34
+ }
35
+
36
+ // the handle: a button with the dots, the cursor of a hand that grabs
37
+ .sortable-handle {
38
+ display: inline-flex;
39
+ flex-shrink: 0;
40
+ align-items: center;
41
+ align-self: flex-start;
42
+ justify-content: center;
43
+ width: var(--sortable-handle-size, 1.75rem);
44
+ height: var(--sortable-handle-size, 1.75rem);
45
+ // the first row of an item is about as tall as the avatar or the icon next to the handle
46
+ margin-block: .125rem;
47
+ padding: 0;
48
+ cursor: grab;
49
+ touch-action: none;
50
+ background: none;
51
+ border: 0;
52
+ border-radius: var(--bs-border-radius-sm);
53
+
54
+ &::before {
55
+ width: .625rem;
56
+ height: 1rem;
57
+ content: '';
58
+ background-color: var(--sortable-handle-color, var(--bs-secondary-color));
59
+ mask: $-grip no-repeat center / contain;
60
+ }
61
+
62
+ &:hover::before,
63
+ &[aria-pressed='true']::before {
64
+ background-color: var(--bs-emphasis-color);
65
+ }
66
+
67
+ &:hover {
68
+ background-color: rgba(var(--bs-body-color-rgb), .05);
69
+ }
70
+
71
+ &:focus {
72
+ outline: 0;
73
+ }
74
+
75
+ &:focus-visible {
76
+ box-shadow: var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color);
77
+ }
78
+ }
79
+
80
+ // the place the dragged item will drop to: a tint and a dashed line, the content stays for its height only
81
+ .sortable-placeholder {
82
+ background-color: var(--sortable-place-bg) !important;
83
+ outline: 1px dashed var(--sortable-place-line);
84
+ outline-offset: -1px;
85
+
86
+ > * {
87
+ visibility: hidden;
88
+ }
89
+ }
90
+
91
+ // the item grabbed by the keyboard (Space): moved by the arrows
92
+ .sortable-grabbed {
93
+ position: relative;
94
+ z-index: 2;
95
+ background-color: var(--sortable-place-bg) !important;
96
+ outline: 1px solid var(--sortable-place-line);
97
+ outline-offset: -1px;
98
+ }
99
+
100
+ // the copy under the pointer: a floating part, so it keeps the shadow
101
+ .sortable-ghost {
102
+ position: fixed;
103
+ top: 0;
104
+ left: 0;
105
+ z-index: 1090;
106
+ margin: 0 !important;
107
+ pointer-events: none;
108
+ background-color: var(--bs-body-bg);
109
+ border-radius: var(--bs-border-radius) !important;
110
+ box-shadow: var(--bs-box-shadow);
111
+ opacity: .95;
112
+
113
+ .sortable-handle {
114
+ cursor: grabbing;
115
+ }
116
+ }
117
+
118
+ // while an item is dragged the whole page has the grabbing hand and no text gets selected
119
+ .sortable-active,
120
+ .sortable-active * {
121
+ cursor: grabbing !important;
122
+ user-select: none;
123
+ }
124
+
125
+ // a list inside an item, one level deeper, under the text of the item
126
+ .sortable-nested {
127
+ width: 100%;
128
+ margin-top: .5rem;
129
+ }
130
+
131
+ .sortable-item:has(> .sortable-nested) {
132
+ flex-wrap: wrap;
133
+
134
+ > .sortable-nested {
135
+ margin-left: var(--sortable-indent);
136
+ }
137
+ }
138
+
139
+ // an empty list is a place to drop on
140
+ .sortable:not(:has(> .sortable-item)) {
141
+ min-height: 2.75rem;
142
+ outline: 1px dashed rgba(var(--bs-body-color-rgb), .15);
143
+ outline-offset: -1px;
144
+ border-radius: var(--bs-border-radius);
145
+
146
+ &::before {
147
+ display: block;
148
+ padding: .625rem 1rem;
149
+ color: var(--bs-secondary-color);
150
+ content: attr(data-sortable-empty);
151
+ }
152
+ }
153
+
154
+ @media (prefers-reduced-motion: reduce) {
155
+ .sortable-ghost {
156
+ opacity: 1;
157
+ }
158
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // sortable module of compostrap
3
+ //
4
+
5
+ @use 'sortable/index';
@@ -2,8 +2,8 @@
2
2
  // theme: offcanvas, modals, dropdowns and toasts
3
3
  //
4
4
 
5
- // offcanvas floats: a gap from the edges of the window, rounded corners and a shadow instead of a border
6
- // (also the line under the header is left out); .offcanvas-flush keeps the panel stuck to the edge. The responsive
5
+ // offcanvas floats: a gap from the edges of the window, rounded corners and a shadow instead of a border;
6
+ // .offcanvas-flush keeps the panel stuck to the edge. The responsive
7
7
  // ones (.offcanvas-lg, …) float below their breakpoint, where they are a panel
8
8
  @mixin cs-offcanvas-float {
9
9
  --cs-offcanvas-margin: .5rem;
@@ -52,8 +52,24 @@
52
52
  }
53
53
  }
54
54
 
55
+ // the line under the header of an offcanvas or a modal goes from the title to the close button only, like the header
56
+ // of a content box; the close button keeps its edge, so the line ends at its cross
57
+ .offcanvas-header,
58
+ .modal-header {
59
+ padding-inline: 0;
60
+ border-bottom: var(--bs-border-width) solid var(--bs-border-color);
61
+
62
+ > .btn-close {
63
+ margin-right: 0;
64
+ }
65
+ }
66
+
55
67
  .offcanvas-header {
56
- border-bottom: 0;
68
+ margin-inline: var(--bs-offcanvas-padding-x);
69
+ }
70
+
71
+ .modal-header {
72
+ margin-inline: var(--bs-modal-header-padding-x);
57
73
  }
58
74
 
59
75
  // a modal lifts by a shadow (Bootstrap adds it only with $enable-shadows)
@@ -1,60 +1,60 @@
1
- //
2
- // theme: tables
3
- //
4
-
5
- // table headers like the section titles of the menu: small, uppercase, muted
6
- .table > thead th {
7
- font-size: .75rem;
8
- font-weight: 500;
9
- letter-spacing: .04em;
10
- text-transform: uppercase;
11
- color: rgba(var(--bs-body-color-rgb), .6);
12
- }
13
-
14
- // sorting links in a table header keep the header look (not a button, e.g. the cross of a datagrid filter)
15
- .table > thead th a:not(.btn) {
16
- color: inherit;
17
- text-decoration: none;
18
-
19
- &:hover {
20
- color: var(--bs-body-color);
21
- }
22
- }
23
-
24
- // icon-only links in a table row (row actions of a datagrid without buttons) are muted until hovered; not the items
25
- // of a menu of row actions (their text is not an element) and not badges (a badge with an icon and a number keeps
26
- // its own padding and color)
27
- .table td a:not(.btn, .dropdown-item, .badge):has(> i:only-child) {
28
- display: inline-block;
29
- padding: 0 .25rem;
30
- color: var(--bs-secondary-color);
31
- text-decoration: none;
32
-
33
- &:hover {
34
- color: var(--bs-body-color);
35
- }
36
- }
37
-
38
- // a table cell with icon buttons (also the button of a menu of row actions) keeps the height of the other cells of its row
39
- .table td:has(> .btn-icon, > .dropdown > .btn-icon) {
40
- padding-top: .375rem;
41
- padding-bottom: .375rem;
42
- white-space: nowrap;
43
- }
44
-
45
- // a table straight in a card lines its first and last column up with the card padding and has no line at its bottom
46
- .card > .table,
47
- .card > .table-responsive > .table {
48
- > :not(caption) > * > :first-child {
49
- padding-left: var(--bs-card-spacer-x);
50
- }
51
-
52
- > :not(caption) > * > :last-child {
53
- padding-right: var(--bs-card-spacer-x);
54
- }
55
-
56
- // no line under the last row, the card ends there
57
- > tbody > tr:last-child > * {
58
- border-bottom-width: 0;
59
- }
60
- }
1
+ //
2
+ // theme: tables
3
+ //
4
+
5
+ // table headers like the section titles of the menu: small, uppercase, muted
6
+ .table > thead th {
7
+ font-size: .75rem;
8
+ font-weight: 500;
9
+ letter-spacing: .04em;
10
+ text-transform: uppercase;
11
+ color: rgba(var(--bs-body-color-rgb), .6);
12
+ }
13
+
14
+ // sorting links in a table header keep the header look (not a button, e.g. the cross of a datagrid filter)
15
+ .table > thead th a:not(.btn) {
16
+ color: inherit;
17
+ text-decoration: none;
18
+
19
+ &:hover {
20
+ color: var(--bs-body-color);
21
+ }
22
+ }
23
+
24
+ // icon-only links in a table row (row actions of a datagrid without buttons) are muted until hovered; not the items
25
+ // of a menu of row actions (their text is not an element) and not badges (a badge with an icon and a number keeps
26
+ // its own padding and color)
27
+ .table td a:not(.btn, .dropdown-item, .badge):has(> i:only-child) {
28
+ display: inline-block;
29
+ padding: 0 .25rem;
30
+ color: var(--bs-secondary-color);
31
+ text-decoration: none;
32
+
33
+ &:hover {
34
+ color: var(--bs-body-color);
35
+ }
36
+ }
37
+
38
+ // a table cell with icon buttons (also the button of a menu of row actions) keeps the height of the other cells of its row
39
+ .table td:has(> .btn-icon, > .dropdown > .btn-icon) {
40
+ padding-top: .375rem;
41
+ padding-bottom: .375rem;
42
+ white-space: nowrap;
43
+ }
44
+
45
+ // a table straight in a card lines its first and last column up with the card padding and has no line at its bottom
46
+ .card > .table,
47
+ .card > .table-responsive > .table {
48
+ > :not(caption) > * > :first-child {
49
+ padding-left: var(--bs-card-spacer-x);
50
+ }
51
+
52
+ > :not(caption) > * > :last-child {
53
+ padding-right: var(--bs-card-spacer-x);
54
+ }
55
+
56
+ // no line under the last row, the card ends there
57
+ > tbody > tr:last-child > * {
58
+ border-bottom-width: 0;
59
+ }
60
+ }
@@ -143,11 +143,10 @@ $accordion-icon-width: 1rem !default;
143
143
  $accordion-button-icon-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='#{$gray-300}' stroke-linecap='round' stroke-linejoin='round'><path d='m2 5 6 6 6-6'/></svg>") !default;
144
144
  $accordion-button-active-icon-dark: $accordion-button-icon-dark !default;
145
145
 
146
- // modals: no border around the window and under the header, a light line above the footer
146
+ // modals: no border around the window and above the footer; the line under the header is in _overlays.scss
147
147
  $modal-content-border-width: 0 !default;
148
148
  $modal-header-border-width: 0 !default;
149
- $modal-footer-border-width: 1px !default;
150
- $modal-footer-border-color: var(--bs-border-color-translucent) !default;
149
+ $modal-footer-border-width: 0 !default;
151
150
 
152
151
  // tables: more air in the rows, also in the small table of a datagrid; a quiet hover
153
152
  $table-cell-padding-y: .625rem !default;