Skip to content

Commit 722e3c6

Browse files
committed
feat: Add styling for button groups
1 parent ab741d2 commit 722e3c6

File tree

8 files changed

+97
-18
lines changed

8 files changed

+97
-18
lines changed

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ may be used optionally in an installation of the software:
4343
* Weather Icons https://erikflowers.github.io/weather-icons/
4444
(SIL Open Font Licence 1.1 https://openfontlicense.org)
4545

46+
It also uses FontAwesome Free icons for UI interface https://fontawesome.com
47+
(CC BY 4.0 License https://creativecommons.org/licenses/by/4.0/) - attribution within the
48+
individual SVG files in djangocms_frontend/contrib/icon/static/djangocms_frontend/icon/vendor/assets

djangocms_frontend/static/djangocms_frontend/css/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

djangocms_frontend/static/djangocms_frontend/css/button_group.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

private/sass/button_group.scss

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "components/variables";
2+
@import "components/bs-buttons";
23

34
form .form-row div.frontend-button-group.frontend-button-group-block {
45
display: flex;
@@ -18,11 +19,15 @@ form .form-row div.frontend-button-group.frontend-button-group-block {
1819
form .form-row div.frontend-button-group {
1920
label.btn-grp {
2021
margin: 3px;
21-
padding: 4px 7px;
22+
23+
&:not(.btn) {
24+
padding: 4px 7px;
25+
}
26+
2227
text-transform: none;
2328
text-align: center !important;
24-
//border-color: transparent !important;
2529
outline: 2px solid transparent;
30+
outline-offset: 2px;
2631
width: auto !important;
2732
font-weight: normal !important;
2833
display: inline-block;
@@ -51,9 +56,14 @@ form .form-row div.frontend-button-group {
5156

5257
input[type="radio"]:checked + label.btn-grp,
5358
input[type="checkbox"]:checked + label.btn-grp {
54-
outline: 2px solid $color-secondary;
55-
border-color: white;
59+
outline-color: $color-primary;
5660
border-radius: 0;
61+
border: none;
62+
}
63+
64+
input[property="icon"] + label.btn-grp {
65+
margin-left: 0.5rem;
66+
margin-right: 0.5rem;
5767
}
5868

5969
input[property="text"]:checked + label.btn-grp,
@@ -65,20 +75,12 @@ form .form-row div.frontend-button-group {
6575
width: 3.5em !important;
6676
padding-inline-start: 0 !important;
6777
padding-inline-end: 0 !important;
68-
color: var(--dca-black, $django-dark-color) !important;
78+
color: $black !important;
6979
overflow: hidden;
7080
white-space: nowrap;
7181
background: rgba(var(--bs-secondary-rgb), calc(var(--fe-value) / 100));
7282
}
7383

74-
input[property="opacity"][value="50"] + label.btn-grp,
75-
input[property="opacity"][value="25"] + label.btn-grp,
76-
input[property="opacity"][value="10"] + label.btn-grp {
77-
@media (prefers-color-scheme: light) {
78-
color: black !important;
79-
}
80-
}
81-
8284
input[property="link-size"][value="btn-lg"] + label.btn-grp {
8385
padding: 0.5rem 1rem !important;
8486
font-size: 1.25rem;
@@ -145,7 +147,7 @@ form .form-row div.frontend-button-group {
145147

146148
.btn-white {
147149
background: white;
148-
color: black !important;
150+
color: $black !important;
149151
}
150152

151153
.btn-light {
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
:root {
3+
--bs-secondary-rgb: 0, 123, 255;
4+
--bs-secondary: #6c757d;
5+
--bs-primary: #0d6efd;
6+
--bs-gray-600: #6c757d;
7+
--bs-gray-900: #212529;
8+
--bs-light: #f8f9fa;
9+
--bs-dark: #343a40;
10+
--bs-white: #fff;
11+
--bs-black: #000;
12+
--bs-success: #198754;
13+
--bs-danger: #dc3545;
14+
--bs-warning: #ffc107;
15+
--bs-info: #0dcaf0;
16+
17+
.btn {
18+
border-color: var(--bs-secondary);
19+
box-shadow: none;
20+
transition: all 0.15s ease-in-out;
21+
22+
&:hover {
23+
color: var(--bs-white);
24+
filter: saturate(60%);
25+
}
26+
27+
&:focus,
28+
&.focus {
29+
filter: saturate(80%);
30+
text-decoration: none;
31+
}
32+
}
33+
34+
.btn {
35+
padding: 0.375rem 0.75rem;
36+
border-radius: 4px;
37+
}
38+
39+
.btn-primary {
40+
color: white;
41+
background-color: var(--bs-primary)
42+
}
43+
.btn-secondary {
44+
color: white;
45+
background-color: var(--bs-secondary)
46+
}
47+
.btn-light {
48+
background-color: var(--bs-light)
49+
}
50+
.btn-dark {
51+
background-color: var(--bs-dark)
52+
}
53+
.btn-success {
54+
color: white;
55+
background-color: var(--bs-success)
56+
}
57+
.btn-danger {
58+
color: $white;
59+
background-color: var(--bs-danger)
60+
}
61+
.btn-warning {
62+
color: black;
63+
background-color: var(--bs-warning)
64+
}
65+
.btn-info {
66+
color: black;
67+
background-color: var(--bs-info)
68+
}
69+
}
70+

private/sass/components/_button-group.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// adds basic active effect
2121
.btn.active {
22-
outline: 3px solid $color-secondary;
22+
outline: 3px solid $color-primary;
2323
border-color: #fff !important;
2424
}
2525

private/sass/components/_tabs.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ form ul.djangocms-frontend.nav {
6565
&.active {
6666
display: block;
6767
}
68+
& > fieldset > h2 {
69+
display: none;
70+
}
6871
}
6972
}
7073

private/sass/components/_variables.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
$color-secondary: var(--dca-secondary, var(--header-bg));
1+
$color-primary: var(--primary);
2+
$color-secondary: var(--dca-action-bg, var(--header-bg));
23
$color-gray: var(--dca-gray, var(--breadcrumbs-fg, #999));
34
$dark-fg: var(--dca-dark-fg, #333);
45

0 commit comments

Comments
 (0)