Skip to content

Commit 1bc7092

Browse files
committed
fix: Adjust button group layout for consistency
1 parent 662b357 commit 1bc7092

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

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.

djangocms_frontend/static/djangocms_frontend/js/grid.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ class GridLayout {
4141
* @method setColumn
4242
*/
4343
setColumn() {
44-
let template = (text = '', link = '#') =>
44+
const infoIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="icon-info icon-primary" viewBox="0 0 16 16"><path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2"/></svg>';
45+
const template = (text = '', link = '#') => (
4546
'<div class="field-box field-box-label">' +
46-
(link != "#" ? `<a href="${link}" target="_blank" class="d-inline-block text-right">` : '')
47+
(link != "#" ? `<a href="${link}" target="_blank">` : '')
4748
+ text
48-
+ (link != "#" ? ' <span class="icon icon-info icon-primary"></span></a>' : "")
49-
+ "</div>";
50-
let container = document.querySelectorAll(this.options.selector);
51-
let links = this.options.links;
49+
+ (link != "#" ? ` ${infoIcon}</a>` : "")
50+
+ '</div>'
51+
);
52+
const container = document.querySelectorAll(this.options.selector);
53+
const links = this.options.links;
5254

5355
Array.from(container).forEach((item, index) => {
5456
item.insertAdjacentHTML('afterbegin', template(this.options.rows[index], links[index]));

private/sass/button_group.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ form .form-row div.frontend-button-group.frontend-button-group-block {
1919
form .form-row div.frontend-button-group {
2020
label.btn-grp {
2121
margin: 3px;
22+
height: 30px;
23+
line-height: calc(30px - 0.15rem);
2224

2325
&:not(.btn) {
2426
padding: 4px 7px;
2527
}
2628

2729
text-transform: none;
2830
text-align: center !important;
29-
outline: 2px solid transparent;
31+
outline: 1px solid transparent;
3032
outline-offset: 2px;
3133
width: auto !important;
3234
font-weight: normal !important;
@@ -48,7 +50,7 @@ form .form-row div.frontend-button-group {
4850
input[type="radio"]:checked + label.btn-grp,
4951
input[type="checkbox"]:checked + label.btn-grp {
5052
outline-color: $color-primary;
51-
border-radius: 0;
53+
border-radius: $btn-border-radius-base;
5254
border: none;
5355
}
5456

private/sass/components/_button-group.scss

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
box-sizing: border-box;
1313
cursor: pointer;
1414
margin: 2px;
15-
padding: 0.375rem 0.75rem;
15+
padding: $nav-pills-padding;
1616
border-radius: 4px;
1717
overflow: hidden;
1818
text-overflow: ellipsis;
@@ -35,7 +35,7 @@
3535

3636
// adds basic active effect
3737
.btn.active {
38-
outline: 3px solid $color-primary;
38+
outline: 1px solid $color-primary;
3939
border-color: #fff !important;
4040
}
4141

@@ -293,17 +293,13 @@
293293

294294
.icon-px {
295295
transform: scale(1.5);
296-
background-image: url('data:image/svg+xml;utf8,<?xml version="1.0" standalone="yes"?><svg xmlns="http://www.w3.org/2000/svg" style="stroke: rgb(15,15,15);;zoom: 1;" viewBox="0 0 48 48"><rect x="9px" height="30px" stroke-width="3px" y="9px" width="30px" fill="transparent" opacity="0.5" transform=""></rect><rect y="11px" stroke-width="none" width="4px" height="26px" x="14px"></rect><rect y="11px" stroke-width="none" width="4px" height="26px" x="30px"></rect></svg>');
296+
background-image: url('data:image/svg+xml;utf8,<?xml version="1.0" standalone="yes"?><svg xmlns="http://www.w3.org/2000/svg" style="stroke: rgb(15,15,15);zoom: 1;" viewBox="0 0 48 48"><rect x="9px" height="30px" stroke-width="3px" y="9px" width="30px" fill="transparent" opacity="0.5" transform=""></rect><rect y="11px" stroke-width="none" width="4px" height="26px" x="14px"></rect><rect y="11px" stroke-width="none" width="4px" height="26px" x="30px"></rect></svg>');
297297
filter: brightness(calc(var(--dca-light-mode, 1) + calc(var(--dca-dark-mode, 0) * 100)));
298298
}
299299

300300
.icon-py {
301301
transform: scale(1.5);
302-
background-image: url('data:image/svg+xml;utf8,<?xml version="1.0" standalone="yes"?><svg xmlns="http://www.w3.org/2000/svg" style="stroke: rgb(15,15,15);;zoom: 1;" viewBox="0 0 48 48"><rect x="9px" height="30px" stroke-width="3px" y="9px" width="30px" fill="transparent" opacity="0.5" transform=""></rect><rect y="31px" stroke-width="none" width="26px" height="4px" x="11px"></rect><rect y="13px" stroke-width="none" width="26px" height="4px" x="11px"></rect></svg>');
302+
background-image: url('data:image/svg+xml;utf8,<?xml version="1.0" standalone="yes"?><svg xmlns="http://www.w3.org/2000/svg" style="stroke: rgb(15,15,15);zoom: 1;" viewBox="0 0 48 48"><rect x="9px" height="30px" stroke-width="3px" y="9px" width="30px" fill="transparent" opacity="0.5" transform=""></rect><rect y="31px" stroke-width="none" width="26px" height="4px" x="11px"></rect><rect y="13px" stroke-width="none" width="26px" height="4px" x="11px"></rect></svg>');
303303
filter: brightness(calc(var(--dca-light-mode, 1) + calc(var(--dca-dark-mode, 0) * 100)));
304304
}
305305
}
306-
307-
.icon-info {
308-
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 448" style="fill: DeepSkyBlue;"><path d="M256 344v-40c0-4.5-3.5-8-8-8h-24v-128c0-4.5-3.5-8-8-8h-80c-4.5 0-8 3.5-8 8v40c0 4.5 3.5 8 8 8h24v80h-24c-4.5 0-8 3.5-8 8v40c0 4.5 3.5 8 8 8h112c4.5 0 8-3.5 8-8zM224 120v-40c0-4.5-3.5-8-8-8h-48c-4.5 0-8 3.5-8 8v40c0 4.5 3.5 8 8 8h48c4.5 0 8-3.5 8-8zM384 224c0 106-86 192-192 192s-192-86-192-192 86-192 192-192 192 86 192 192z"></path></svg>');
309-
}

private/sass/components/_icons.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
}
1919

2020
.icon-info {
21-
width: 0.9em;
22-
font-size: 110% !important;
21+
margin-inline-start: 0.5em;
22+
zoom: 85%;
2323
}
2424

2525
$svg-colors: (
2626
"white": white,
2727
"black": black,
28-
"primary": #0bf,
28+
"primary": $color-primary,
2929
);
3030

3131
@each $key in map.keys($svg-colors) {

private/sass/components/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $font-size-base: 0.8125rem;
1010
$nav-pills-color: var(--dca-action-text, $body-bg);
1111
$nav-pills-background: $color-secondary;
1212
$nav-link-padding-y: 0.3rem;
13-
$nav-pills-padding: 1px 12px;
13+
$nav-pills-padding: 0.15rem 0.75rem;
1414
$nav-pills-margin: 0.5rem;
1515
$nav-pills-border-radius: 4px;
1616
$nav-pills-height: 30px;

0 commit comments

Comments
 (0)