compostrap 0.0.0-stage → 1.0.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.
- package/dist/css/auth.css +166 -0
- package/dist/css/blog.css +512 -0
- package/dist/css/chart.css +99 -0
- package/dist/css/compostrap.css +5047 -0
- package/dist/css/dashboard.css +360 -0
- package/dist/css/datagrid.css +64 -0
- package/dist/css/datepicker.css +514 -0
- package/dist/css/dialogs.css +185 -0
- package/dist/css/dropzone.css +86 -0
- package/dist/css/elements.css +181 -0
- package/dist/css/empty.css +94 -0
- package/dist/css/gallery.css +122 -0
- package/dist/css/lightbox.css +140 -0
- package/dist/css/number-input.css +100 -0
- package/dist/css/otp-input.css +177 -0
- package/dist/css/password-toggle.css +52 -0
- package/dist/css/rating.css +95 -0
- package/dist/css/selection.css +59 -0
- package/dist/css/settings.css +85 -0
- package/dist/css/shop.css +1026 -0
- package/dist/css/sidebar-menu.css +438 -0
- package/dist/css/sidebar.css +95 -0
- package/dist/css/spinner.css +102 -0
- package/dist/css/strength.css +118 -0
- package/dist/css/theme-switcher.css +5 -0
- package/dist/css/theme.css +13006 -0
- package/dist/css/tooltip.css +158 -0
- package/dist/js/chart.js +257 -0
- package/dist/js/datepicker.js +82 -0
- package/dist/js/dialogs.js +7 -0
- package/dist/js/dropzone.js +15 -0
- package/dist/js/index.js +24 -0
- package/dist/js/lightbox.js +77 -0
- package/dist/js/number-input.js +44 -0
- package/dist/js/otp-input.js +182 -0
- package/dist/js/password-toggle.js +16 -0
- package/dist/js/selection.js +32 -0
- package/dist/js/sidebar-menu.js +76 -0
- package/dist/js/sidebar.js +120 -0
- package/dist/js/spinner.js +27 -0
- package/dist/js/strength.js +87 -0
- package/dist/js/theme-switcher.js +98 -0
- package/dist/js/tooltip.js +17 -0
- package/docs/auth.md +25 -0
- package/docs/blog.md +85 -0
- package/docs/chart.md +39 -0
- package/docs/datagrid.md +64 -0
- package/docs/datepicker.md +35 -0
- package/docs/dialogs.md +81 -0
- package/docs/dropzone.md +23 -0
- package/docs/elements.md +38 -0
- package/docs/empty.md +25 -0
- package/docs/gallery.md +23 -0
- package/docs/layout.md +143 -0
- package/docs/lightbox.md +18 -0
- package/docs/number-input.md +19 -0
- package/docs/otp-input.md +52 -0
- package/docs/password-toggle.md +21 -0
- package/docs/rating.md +15 -0
- package/docs/selection.md +52 -0
- package/docs/settings.md +25 -0
- package/docs/shop.md +140 -0
- package/docs/spinner.md +51 -0
- package/docs/strength.md +26 -0
- package/docs/theme-switcher.md +60 -0
- package/docs/theme.md +100 -0
- package/docs/tooltip.md +30 -0
- package/license +21 -0
- package/package.json +106 -6
- package/readme.md +198 -0
- package/src/illustrations/empty.svg +15 -0
- package/src/illustrations/forbidden.svg +16 -0
- package/src/illustrations/maintenance.svg +14 -0
- package/src/illustrations/not-found.svg +22 -0
- package/src/illustrations/server-error.svg +21 -0
- package/src/js/chart.js +359 -0
- package/src/js/datepicker.js +154 -0
- package/src/js/dialogs.js +25 -0
- package/src/js/dropzone.js +35 -0
- package/src/js/index.js +29 -0
- package/src/js/lightbox.js +165 -0
- package/src/js/number-input.js +87 -0
- package/src/js/otp-input.js +401 -0
- package/src/js/password-toggle.js +45 -0
- package/src/js/selection.js +114 -0
- package/src/js/sidebar-menu.js +178 -0
- package/src/js/sidebar.js +326 -0
- package/src/js/spinner.js +76 -0
- package/src/js/strength.js +115 -0
- package/src/js/theme-switcher.js +197 -0
- package/src/js/tooltip.js +46 -0
- package/src/scss/_bootstrap.scss +9 -0
- package/src/scss/_variables.scss +58 -0
- package/src/scss/auth/_index.scss +210 -0
- package/src/scss/auth.scss +5 -0
- package/src/scss/blog/_article.scss +181 -0
- package/src/scss/blog/_comments.scss +108 -0
- package/src/scss/blog/_index.scss +18 -0
- package/src/scss/blog/_list.scss +246 -0
- package/src/scss/blog/_page.scss +138 -0
- package/src/scss/blog.scss +5 -0
- package/src/scss/chart/_index.scss +114 -0
- package/src/scss/chart.scss +5 -0
- package/src/scss/compostrap.scss +29 -0
- package/src/scss/dashboard/_content.scss +25 -0
- package/src/scss/dashboard/_dropdown.scss +71 -0
- package/src/scss/dashboard/_index.scss +9 -0
- package/src/scss/dashboard/_nanobar.scss +34 -0
- package/src/scss/dashboard/_navbar.scss +314 -0
- package/src/scss/dashboard/_theme.scss +27 -0
- package/src/scss/dashboard.scss +5 -0
- package/src/scss/datagrid/_index.scss +111 -0
- package/src/scss/datagrid.scss +5 -0
- package/src/scss/datepicker/_index.scss +557 -0
- package/src/scss/datepicker.scss +5 -0
- package/src/scss/dialogs/_index.scss +8 -0
- package/src/scss/dialogs/_modal.scss +82 -0
- package/src/scss/dialogs/_offcanvas.scss +13 -0
- package/src/scss/dialogs/_search.scss +79 -0
- package/src/scss/dialogs/_toast.scss +61 -0
- package/src/scss/dialogs.scss +5 -0
- package/src/scss/dropzone/_index.scss +111 -0
- package/src/scss/dropzone.scss +5 -0
- package/src/scss/elements/_datagrid-filter.scss +21 -0
- package/src/scss/elements/_index.scss +9 -0
- package/src/scss/elements/_list-row.scss +40 -0
- package/src/scss/elements/_loading.scss +47 -0
- package/src/scss/elements/_stat.scss +73 -0
- package/src/scss/elements/_status-dot.scss +38 -0
- package/src/scss/elements.scss +5 -0
- package/src/scss/empty/_index.scss +117 -0
- package/src/scss/empty.scss +5 -0
- package/src/scss/gallery/_index.scss +162 -0
- package/src/scss/gallery.scss +5 -0
- package/src/scss/lightbox/_index.scss +164 -0
- package/src/scss/lightbox.scss +5 -0
- package/src/scss/number-input/_index.scss +143 -0
- package/src/scss/number-input.scss +5 -0
- package/src/scss/otp-input/_index.scss +214 -0
- package/src/scss/otp-input.scss +5 -0
- package/src/scss/password-toggle/_index.scss +82 -0
- package/src/scss/password-toggle.scss +5 -0
- package/src/scss/rating/_index.scss +121 -0
- package/src/scss/rating.scss +5 -0
- package/src/scss/selection/_index.scss +84 -0
- package/src/scss/selection.scss +5 -0
- package/src/scss/settings/_index.scss +6 -0
- package/src/scss/settings/_nav-list.scss +52 -0
- package/src/scss/settings/_setting-row.scss +50 -0
- package/src/scss/settings.scss +5 -0
- package/src/scss/shop/_bar.scss +64 -0
- package/src/scss/shop/_catalog.scss +308 -0
- package/src/scss/shop/_checkout.scss +204 -0
- package/src/scss/shop/_filters.scss +116 -0
- package/src/scss/shop/_hero.scss +130 -0
- package/src/scss/shop/_index.scss +22 -0
- package/src/scss/shop/_page.scss +154 -0
- package/src/scss/shop/_reviews.scss +165 -0
- package/src/scss/shop/_stepper.scss +159 -0
- package/src/scss/shop.scss +5 -0
- package/src/scss/sidebar/_body.scss +8 -0
- package/src/scss/sidebar/_index.scss +8 -0
- package/src/scss/sidebar/_sidebar.scss +89 -0
- package/src/scss/sidebar/_theme.scss +7 -0
- package/src/scss/sidebar/_wrapper.scss +17 -0
- package/src/scss/sidebar-menu/_compact.scss +173 -0
- package/src/scss/sidebar-menu/_index.scss +9 -0
- package/src/scss/sidebar-menu/_list.scss +131 -0
- package/src/scss/sidebar-menu/_pills.scss +82 -0
- package/src/scss/sidebar-menu/_scrollbar.scss +53 -0
- package/src/scss/sidebar-menu/_theme.scss +109 -0
- package/src/scss/sidebar-menu.scss +5 -0
- package/src/scss/sidebar.scss +5 -0
- package/src/scss/spinner/_index.scss +130 -0
- package/src/scss/spinner.scss +5 -0
- package/src/scss/strength/_index.scss +118 -0
- package/src/scss/strength.scss +5 -0
- package/src/scss/theme/_accordion.scss +20 -0
- package/src/scss/theme/_alerts.scss +24 -0
- package/src/scss/theme/_avatar.scss +37 -0
- package/src/scss/theme/_badges.scss +53 -0
- package/src/scss/theme/_base.scss +9 -0
- package/src/scss/theme/_breadcrumb.scss +64 -0
- package/src/scss/theme/_buttons.scss +200 -0
- package/src/scss/theme/_cards.scss +17 -0
- package/src/scss/theme/_colors.scss +139 -0
- package/src/scss/theme/_forms.scss +175 -0
- package/src/scss/theme/_index.scss +18 -0
- package/src/scss/theme/_navs.scss +15 -0
- package/src/scss/theme/_overlays.scss +114 -0
- package/src/scss/theme/_tables.scss +59 -0
- package/src/scss/theme/_variables.scss +189 -0
- package/src/scss/theme-switcher/_index.scss +9 -0
- package/src/scss/theme-switcher.scss +5 -0
- package/src/scss/theme.scss +9 -0
- package/src/scss/tooltip/_index.scss +177 -0
- package/src/scss/tooltip.scss +5 -0
- package/README.md +0 -3
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
//
|
|
2
|
+
// theme: Bootstrap variables in the look of Bootstrap 6 (neutral grays, 14px text, quieter shadows and controls)
|
|
3
|
+
//
|
|
4
|
+
// Loaded before Bootstrap by @import, so every component of Bootstrap is built with them. All values are !default:
|
|
5
|
+
// a project can set its own before this file.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// neutral grays without the blue tint of Bootstrap
|
|
9
|
+
$gray-100: #f5f5f5 !default;
|
|
10
|
+
$gray-200: #e5e5e5 !default;
|
|
11
|
+
$gray-300: #d4d4d4 !default;
|
|
12
|
+
$gray-400: #a3a3a3 !default;
|
|
13
|
+
$gray-500: #737373 !default;
|
|
14
|
+
$gray-600: #525252 !default;
|
|
15
|
+
$gray-700: #404040 !default;
|
|
16
|
+
$gray-800: #262626 !default;
|
|
17
|
+
$gray-900: #171717 !default;
|
|
18
|
+
|
|
19
|
+
// colors of Bootstrap 6 (its oklch values converted to hex): a lighter, clearer blue and livelier status colors
|
|
20
|
+
$blue: #0089d7 !default;
|
|
21
|
+
$indigo: #7740ff !default;
|
|
22
|
+
$purple: #ae29c9 !default;
|
|
23
|
+
$pink: #e12871 !default;
|
|
24
|
+
$red: #e62845 !default;
|
|
25
|
+
$orange: #fb6f00 !default;
|
|
26
|
+
$yellow: #ffce00 !default;
|
|
27
|
+
$green: #00aa67 !default;
|
|
28
|
+
$teal: #00b2ab !default;
|
|
29
|
+
$cyan: #00afd9 !default;
|
|
30
|
+
|
|
31
|
+
// green as a text on a light surface (.text-success, the text of a valid field): the green darkened by 16 % in oklch,
|
|
32
|
+
// the least that reads 4.5:1 on white (the green itself has 3:1); the dark theme keeps the green
|
|
33
|
+
$success-text: #00874f !default;
|
|
34
|
+
$form-valid-color: $success-text !default;
|
|
35
|
+
|
|
36
|
+
// white text on blue, green, red and orange like in Bootstrap 6, dark text on yellow and cyan
|
|
37
|
+
$min-contrast-ratio: 2.7 !default;
|
|
38
|
+
|
|
39
|
+
// body: dark gray text, the page background just off white (the dashboard uses the tertiary background)
|
|
40
|
+
$body-color: $gray-800 !default;
|
|
41
|
+
$body-tertiary-bg: #fafafa !default;
|
|
42
|
+
$border-color: $gray-200 !default;
|
|
43
|
+
|
|
44
|
+
// typography: 14px text with 20px lines; headings semibold in a compact scale (h5 stays readable, it heads pages
|
|
45
|
+
// and boxes in administrations)
|
|
46
|
+
$font-size-base: .875rem !default;
|
|
47
|
+
$line-height-base: 1.4285714286 !default;
|
|
48
|
+
$headings-font-weight: 600 !default;
|
|
49
|
+
// small text (small, .small, form texts, feedback, the footer of a quote) in the size of the text: nothing readable is
|
|
50
|
+
// under 14px unless it is a -sm size, a badge or an uppercase label
|
|
51
|
+
$small-font-size: 1em !default;
|
|
52
|
+
// the footer of a quote in the secondary color of the theme: the fixed gray of Bootstrap was 2.3:1 on the dark surface
|
|
53
|
+
$blockquote-footer-color: var(--bs-secondary-color) !default;
|
|
54
|
+
$h1-font-size: 1.75rem !default;
|
|
55
|
+
$h2-font-size: 1.5rem !default;
|
|
56
|
+
$h3-font-size: 1.3125rem !default;
|
|
57
|
+
$h4-font-size: 1.1875rem !default;
|
|
58
|
+
$h5-font-size: 1.125rem !default;
|
|
59
|
+
$h6-font-size: .875rem !default;
|
|
60
|
+
$link-decoration: none !default;
|
|
61
|
+
$link-hover-decoration: underline !default;
|
|
62
|
+
|
|
63
|
+
// shadows: hardly visible, they only lift a surface from the page; the small one is the soft shadow of compostrap
|
|
64
|
+
// ($soft-shadow), which boxes and cards use instead of a border
|
|
65
|
+
$box-shadow-sm: none !default; // as $soft-shadow of the modules: no shadow for now
|
|
66
|
+
|
|
67
|
+
// a faint line around a card, as $surface-border of the modules: none for now
|
|
68
|
+
$surface-border: none !default;
|
|
69
|
+
$box-shadow: 0 2px 4px -1px rgba(18, 18, 23, .06), 0 4px 6px -1px rgba(18, 18, 23, .08) !default;
|
|
70
|
+
$box-shadow-lg: 0 4px 6px -2px rgba(18, 18, 23, .05), 0 10px 15px -3px rgba(18, 18, 23, .08) !default;
|
|
71
|
+
|
|
72
|
+
// buttons and form controls share one scale: 36px, small 30px, large 44px; buttons are medium
|
|
73
|
+
$input-btn-padding-y: .4375rem !default;
|
|
74
|
+
$input-btn-padding-x: .75rem !default;
|
|
75
|
+
$input-btn-padding-y-sm: .3125rem !default;
|
|
76
|
+
$input-btn-padding-x-sm: .625rem !default;
|
|
77
|
+
$input-btn-padding-y-lg: .5625rem !default;
|
|
78
|
+
$input-btn-padding-x-lg: 1.25rem !default;
|
|
79
|
+
$btn-font-weight: 500 !default;
|
|
80
|
+
|
|
81
|
+
// focus: no wide glow, the border turns into the primary color (tinted by 50 %) with a 1px ring of it around, so
|
|
82
|
+
// together a clean 2px line; buttons and checks get the same thin ring
|
|
83
|
+
$focus-ring-width: 1px !default;
|
|
84
|
+
$focus-ring-opacity: .6 !default;
|
|
85
|
+
// a text field and a select show their focus by the tinted border only, without the ring around it
|
|
86
|
+
$input-focus-box-shadow: none !default;
|
|
87
|
+
$form-select-focus-box-shadow: none !default;
|
|
88
|
+
$form-label-font-weight: 500 !default;
|
|
89
|
+
$form-label-margin-bottom: .375rem !default;
|
|
90
|
+
|
|
91
|
+
// checks, radios and switches of the size of Bootstrap 6: 20px boxes as high as a line of text, a 35 × 20px switch
|
|
92
|
+
// with a white knob on a gray track (the track color is in theme/_index.scss)
|
|
93
|
+
$form-check-input-width: 1.25rem !default;
|
|
94
|
+
$form-check-padding-start: 1.75rem !default;
|
|
95
|
+
$form-check-input-border-radius: .3125rem !default;
|
|
96
|
+
$form-check-input-checked-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='#fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5.5 10 3 3 6-6'/></svg>") !default;
|
|
97
|
+
$form-check-input-indeterminate-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='#fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 10h8'/></svg>") !default;
|
|
98
|
+
$form-switch-width: 2.1875rem !default;
|
|
99
|
+
$form-switch-padding-start: 2.6875rem !default;
|
|
100
|
+
$form-switch-color: #fff !default;
|
|
101
|
+
$form-switch-focus-color: #fff !default;
|
|
102
|
+
$form-switch-color-dark: #fff !default;
|
|
103
|
+
$form-switch-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3.2' fill='#fff'/></svg>") !default;
|
|
104
|
+
$form-switch-focus-bg-image: $form-switch-bg-image !default;
|
|
105
|
+
$form-switch-checked-bg-image: $form-switch-bg-image !default;
|
|
106
|
+
$form-switch-bg-image-dark: $form-switch-bg-image !default;
|
|
107
|
+
|
|
108
|
+
// cards: no border (the soft shadow lifts them), a larger radius, a calm header
|
|
109
|
+
$card-border-width: 0 !default;
|
|
110
|
+
$card-border-radius: .5rem !default;
|
|
111
|
+
$card-spacer-y: 1.25rem !default;
|
|
112
|
+
$card-spacer-x: 1.25rem !default;
|
|
113
|
+
$card-cap-padding-y: 1rem !default;
|
|
114
|
+
$card-cap-bg: transparent !default;
|
|
115
|
+
|
|
116
|
+
// dropdowns: no border (the shadow lifts them), a faint divider, the chosen item (e.g. the current language) is tinted, not filled with the primary color
|
|
117
|
+
$dropdown-border-width: 0 !default;
|
|
118
|
+
$dropdown-divider-bg: rgba(var(--bs-body-color-rgb), .08) !default;
|
|
119
|
+
$dropdown-link-active-color: var(--bs-body-color) !default;
|
|
120
|
+
$dropdown-link-active-bg: rgba(var(--bs-primary-rgb), .1) !default;
|
|
121
|
+
|
|
122
|
+
// toasts in the look of the modals: no border, an opaque surface, larger corners and the large shadow
|
|
123
|
+
$toast-padding-x: 1rem !default;
|
|
124
|
+
$toast-padding-y: .75rem !default;
|
|
125
|
+
$toast-background-color: var(--bs-body-bg) !default;
|
|
126
|
+
$toast-border-width: 0 !default;
|
|
127
|
+
$toast-border-radius: var(--bs-border-radius-lg) !default;
|
|
128
|
+
$toast-box-shadow: var(--bs-box-shadow-lg) !default;
|
|
129
|
+
$toast-header-background-color: transparent !default;
|
|
130
|
+
|
|
131
|
+
// accordion like in Bootstrap 6: the open item is a light gray (half the border color on the surface, so it sits with
|
|
132
|
+
// the lines in both themes), its text and arrow stay in the body color, the arrow is a thin chevron
|
|
133
|
+
$accordion-button-active-bg: color-mix(in srgb, var(--bs-border-color) 50%, var(--bs-body-bg)) !default;
|
|
134
|
+
$accordion-button-active-color: var(--bs-body-color) !default;
|
|
135
|
+
$accordion-icon-color: $body-color !default;
|
|
136
|
+
$accordion-icon-active-color: $body-color !default;
|
|
137
|
+
$accordion-icon-width: 1rem !default;
|
|
138
|
+
$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;
|
|
139
|
+
$accordion-button-active-icon-dark: $accordion-button-icon-dark !default;
|
|
140
|
+
|
|
141
|
+
// modals: no border around the window and under the header, a light line above the footer
|
|
142
|
+
$modal-content-border-width: 0 !default;
|
|
143
|
+
$modal-header-border-width: 0 !default;
|
|
144
|
+
$modal-footer-border-width: 1px !default;
|
|
145
|
+
$modal-footer-border-color: var(--bs-border-color-translucent) !default;
|
|
146
|
+
|
|
147
|
+
// tables: more air in the rows, also in the small table of a datagrid; a quiet hover
|
|
148
|
+
$table-cell-padding-y: .625rem !default;
|
|
149
|
+
$table-cell-padding-x: .75rem !default;
|
|
150
|
+
$table-cell-padding-y-sm: .5rem !default;
|
|
151
|
+
$table-cell-padding-x-sm: .625rem !default;
|
|
152
|
+
// (.035 was too strong for the user)
|
|
153
|
+
$table-hover-bg-factor: .02 !default;
|
|
154
|
+
$table-active-bg-factor: .04 !default;
|
|
155
|
+
|
|
156
|
+
// pagination: separate rounded buttons without borders, the current page in the primary color
|
|
157
|
+
$pagination-border-width: 0 !default;
|
|
158
|
+
$pagination-margin-start: .25rem !default;
|
|
159
|
+
$pagination-color: var(--bs-body-color) !default;
|
|
160
|
+
$pagination-bg: transparent !default;
|
|
161
|
+
$pagination-hover-color: var(--bs-body-color) !default;
|
|
162
|
+
$pagination-hover-bg: var(--bs-secondary-bg) !default;
|
|
163
|
+
$pagination-focus-bg: var(--bs-secondary-bg) !default;
|
|
164
|
+
// no ring around the focused page: the tint of the focus background shows it (a ring looked like a border)
|
|
165
|
+
$pagination-focus-box-shadow: none !default;
|
|
166
|
+
$pagination-disabled-color: var(--bs-tertiary-color) !default;
|
|
167
|
+
$pagination-disabled-bg: transparent !default;
|
|
168
|
+
$pagination-padding-x-sm: .625rem !default;
|
|
169
|
+
|
|
170
|
+
// badges like in Bootstrap 6: semibold, at least 22px high (the rest is in theme/_index.scss); the corners stay those
|
|
171
|
+
// of Bootstrap 5
|
|
172
|
+
$badge-font-size: .75rem !default; // 12px, the least of Bootstrap 6
|
|
173
|
+
$badge-font-weight: 600 !default;
|
|
174
|
+
$badge-padding-y: .25em !default;
|
|
175
|
+
$badge-padding-x: .625em !default;
|
|
176
|
+
|
|
177
|
+
// navs like in Bootstrap 6: gray links that darken on hover, a light background on hover; a hovered tab gets only a
|
|
178
|
+
// faint frame (the full frame of Bootstrap 5 stuck to the frame of the active tab), tabs keep a 2px gap (theme/_index)
|
|
179
|
+
$nav-link-color: var(--bs-secondary-color) !default;
|
|
180
|
+
$nav-link-hover-color: var(--bs-emphasis-color) !default;
|
|
181
|
+
$nav-link-disabled-color: var(--bs-tertiary-color) !default;
|
|
182
|
+
$nav-tabs-link-active-color: var(--bs-body-color) !default;
|
|
183
|
+
$nav-tabs-link-hover-border-color: color-mix(in srgb, var(--bs-border-color) 50%, transparent) color-mix(in srgb, var(--bs-border-color) 50%, transparent) var(--bs-border-color) !default;
|
|
184
|
+
|
|
185
|
+
// no animation on hover anywhere: buttons, nav links and pages change their colors at once
|
|
186
|
+
$btn-transition: none !default;
|
|
187
|
+
$nav-link-transition: none !default;
|
|
188
|
+
$pagination-transition: none !default;
|
|
189
|
+
$accordion-transition: border-radius .15s ease !default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//
|
|
2
|
+
// theme module of compostrap: Bootstrap built with the theme variables, then the theme additions
|
|
3
|
+
//
|
|
4
|
+
// Use it instead of `@import 'bootstrap/scss/bootstrap'`; set own variables before it.
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
@import 'theme/variables';
|
|
8
|
+
@import 'bootstrap/scss/bootstrap';
|
|
9
|
+
@import 'theme/index';
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Tooltip of pure CSS, for buttons with an icon only: the text of aria-label shown on hover and keyboard focus,
|
|
3
|
+
// dark on a light page and light on a dark one (also for outline buttons, which have no background of their own),
|
|
4
|
+
// so it needs no JavaScript and survives Naja snippets (the optional script CssTooltip only adds Esc, which hides
|
|
5
|
+
// the shown tooltip).
|
|
6
|
+
// <a class="btn btn-sm btn-danger" aria-label="Delete" data-tooltip><i class="bi bi-trash"></i></a>
|
|
7
|
+
// data-tooltip="left" shows it on the left, e.g. at the right edge of a table, data-tooltip="end" above but aligned to
|
|
8
|
+
// the right edge, data-tooltip="bottom" under the element, e.g. in a navbar; data-tooltip-color="success" (any theme color of Bootstrap) colors it, with dark text on the light
|
|
9
|
+
// colors.
|
|
10
|
+
//
|
|
11
|
+
|
|
12
|
+
@use '../bootstrap' as bs;
|
|
13
|
+
|
|
14
|
+
// the default tooltip: a dark gray with white text in the light theme (the gray of the gray navbar, softer than the
|
|
15
|
+
// black of the text), the light text color with dark text in the dark theme, where a dark gray would sink into the page
|
|
16
|
+
:root,
|
|
17
|
+
[data-bs-theme='light'] {
|
|
18
|
+
--cs-tooltip-default-bg: #{bs.$gray-600};
|
|
19
|
+
--cs-tooltip-default-color: #fff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-bs-theme='dark'] {
|
|
23
|
+
--cs-tooltip-default-bg: var(--bs-emphasis-color);
|
|
24
|
+
--cs-tooltip-default-color: var(--bs-body-bg);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The tooltip exists only while it is shown: a hidden one (opacity 0) would still widen the scroll area of its
|
|
28
|
+
// container, e.g. a table-responsive with buttons in the last column would get a horizontal scrollbar. So it is
|
|
29
|
+
// created on hover or focus and fades in by an animation.
|
|
30
|
+
[data-tooltip] {
|
|
31
|
+
position: relative;
|
|
32
|
+
|
|
33
|
+
&::after {
|
|
34
|
+
position: absolute;
|
|
35
|
+
bottom: calc(100% + .375rem);
|
|
36
|
+
left: 50%;
|
|
37
|
+
z-index: 1080;
|
|
38
|
+
padding: .25rem .5rem;
|
|
39
|
+
border-radius: var(--bs-border-radius-sm);
|
|
40
|
+
background-color: var(--cs-tooltip-bg, var(--cs-tooltip-default-bg));
|
|
41
|
+
color: var(--cs-tooltip-color, var(--cs-tooltip-default-color));
|
|
42
|
+
font-size: .75rem;
|
|
43
|
+
font-weight: 400;
|
|
44
|
+
line-height: 1.2;
|
|
45
|
+
// its own text also where the element stands in uppercase or spaced text (a table head, a menu section)
|
|
46
|
+
text-transform: none;
|
|
47
|
+
letter-spacing: normal;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
transform: translate(-50%, 0);
|
|
51
|
+
animation: cs-tooltip-up .15s ease-out;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover::after,
|
|
55
|
+
&:focus-visible::after {
|
|
56
|
+
content: attr(aria-label);
|
|
57
|
+
// the text is the aria-label of the element already: the empty alternative keeps a screen reader from
|
|
58
|
+
// reading it twice (a browser without this syntax keeps the line above)
|
|
59
|
+
content: attr(aria-label) / '';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// a button whose dropdown is open shows the dropdown, not its tooltip over it
|
|
63
|
+
&[aria-expanded='true']::after {
|
|
64
|
+
content: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// hidden by Esc (the script CssTooltip) until the mouse and the focus leave the element
|
|
68
|
+
&[data-tooltip-hidden]::after {
|
|
69
|
+
content: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-tooltip='left'] {
|
|
74
|
+
&::after {
|
|
75
|
+
top: 50%;
|
|
76
|
+
bottom: auto;
|
|
77
|
+
left: auto;
|
|
78
|
+
right: calc(100% + .375rem);
|
|
79
|
+
transform: translate(0, -50%);
|
|
80
|
+
animation-name: cs-tooltip-left;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// above the element, aligned to its right edge, so it does not reach out of its container (a button at the right
|
|
85
|
+
// edge of a card or an offcanvas)
|
|
86
|
+
[data-tooltip='end'] {
|
|
87
|
+
&::after {
|
|
88
|
+
right: 0;
|
|
89
|
+
left: auto;
|
|
90
|
+
transform: none;
|
|
91
|
+
animation-name: cs-tooltip-up-end;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// above the element, aligned to its left edge, so a wide tooltip of an element near the left edge of its container
|
|
96
|
+
// grows to the right
|
|
97
|
+
[data-tooltip='start'] {
|
|
98
|
+
&::after {
|
|
99
|
+
left: 0;
|
|
100
|
+
transform: none;
|
|
101
|
+
animation-name: cs-tooltip-up-end;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// a long text (e.g. a list): it wraps within a width instead of running out of the window, keeps the line breaks
|
|
106
|
+
// of its aria-label (one item per line) and is aligned to the left
|
|
107
|
+
[data-tooltip-wrap]::after {
|
|
108
|
+
width: max-content;
|
|
109
|
+
max-width: min(22rem, calc(100vw - 2rem));
|
|
110
|
+
white-space: pre-line;
|
|
111
|
+
overflow-wrap: anywhere;
|
|
112
|
+
text-align: start;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// under the element, e.g. in a navbar at the top of the window
|
|
116
|
+
[data-tooltip='bottom'] {
|
|
117
|
+
&::after {
|
|
118
|
+
top: calc(100% + .375rem);
|
|
119
|
+
bottom: auto;
|
|
120
|
+
animation-name: cs-tooltip-down;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@keyframes cs-tooltip-up {
|
|
125
|
+
from {
|
|
126
|
+
opacity: 0;
|
|
127
|
+
transform: translate(-50%, .25rem);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes cs-tooltip-up-end {
|
|
132
|
+
from {
|
|
133
|
+
opacity: 0;
|
|
134
|
+
transform: translateY(.25rem);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@keyframes cs-tooltip-down {
|
|
139
|
+
from {
|
|
140
|
+
opacity: 0;
|
|
141
|
+
transform: translate(-50%, -.25rem);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes cs-tooltip-left {
|
|
146
|
+
from {
|
|
147
|
+
opacity: 0;
|
|
148
|
+
transform: translate(-.25rem, -50%);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// colored tooltips: the color of Bootstrap at run time, the text color chosen for it when the styles are built
|
|
153
|
+
@each $name, $value in bs.$theme-colors {
|
|
154
|
+
[data-tooltip-color='#{$name}'] {
|
|
155
|
+
--cs-tooltip-bg: var(--bs-#{$name});
|
|
156
|
+
--cs-tooltip-color: #{bs.color-contrast($value)};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// info has white text like the info buttons and badges of the theme (the dark text of Bootstrap was too heavy on
|
|
161
|
+
// cyan), on the cyan darkened by 14 % as there, so the white reads
|
|
162
|
+
[data-tooltip-color='info'] {
|
|
163
|
+
--cs-tooltip-bg: color-mix(in oklch, var(--bs-info) 86%, #000);
|
|
164
|
+
--cs-tooltip-color: #fff;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// warning has the brown text of the solid warning button of the theme (the yellow mixed with 54 % black, see
|
|
168
|
+
// $theme-contrast-weights in theme/_colors.scss), not the near black of Bootstrap
|
|
169
|
+
[data-tooltip-color='warning'] {
|
|
170
|
+
--cs-tooltip-color: color-mix(in oklch, var(--bs-warning), #000 54%);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@media (prefers-reduced-motion: reduce) {
|
|
174
|
+
[data-tooltip]::after {
|
|
175
|
+
animation: none;
|
|
176
|
+
}
|
|
177
|
+
}
|
package/README.md
DELETED