Skip to content

Commit

Permalink
Merge pull request #202 from hlxsites/bug/table-issues
Browse files Browse the repository at this point in the history
Minor bug issues
  • Loading branch information
pardeepgera23 authored Nov 30, 2023
2 parents 65127e8 + 8b5ebe5 commit 3b29c2e
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 19 deletions.
11 changes: 10 additions & 1 deletion blocks/recent-posts/recent-posts.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@
height: auto;
}

@media (max-width: 1024px) {
.grey-article-outer {
padding-left: 20px;
padding-right: 20px;
width: auto;
}
}

@media (max-width: 767px) {
.grey-article-outer {
padding: 60px 0;
padding: 60px 20px;
}

.recent-posts .content .col {
width: 100%;
margin: 0!important;
}
}
2 changes: 1 addition & 1 deletion blocks/rte/rte.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.rte {
padding: 50px 0;
padding: 16px 0;
}
2 changes: 2 additions & 0 deletions blocks/table/table.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.heading-top tr:first-child td {
background-color: var(--primary-color);
color: #fff;
}

.left-heading {
background-color: var(--primary-color);
color: #fff;
text-align: left;
}

Expand Down
6 changes: 6 additions & 0 deletions blocks/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export default function decorate(block) {
const rowspan = td.getAttribute('rowspan');
if (rowspan !== null && rowspan > 1) {
const rowspanCount = parseInt(rowspan, 10);
if (rowspanCount > 1) {
for (let i = 1; i < rowspanCount; i += 1) {
const parent = td.parentElement;
parent.classList.add('bg-white');
}
}
index += rowspanCount;
} else {
index += 1;
Expand Down
17 changes: 17 additions & 0 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,15 @@ function decorateButtons(element) {
a.setAttribute('target', '_blank');
twoup.classList.add('button-container');
}
if (
up.childNodes.length === 1
&& up.tagName === 'EM'
&& twoup.childNodes.length === 1
&& twoup.tagName === 'STRONG'
) {
a.setAttribute('target', '_blank');
a.classList.add('text-normal');
}
if (
up.childNodes.length === 1
&& up.tagName === 'EM'
Expand All @@ -466,6 +475,14 @@ function decorateButtons(element) {
a.className = 'button secondary';
twoup.classList.add('button-container');
}
if (
up.childNodes.length === 1
&& up.tagName === 'STRONG'
&& twoup.childNodes.length === 1
) {
a.setAttribute('target', '_blank');
a.classList.add('text-normal');
}
}
}
});
Expand Down
42 changes: 25 additions & 17 deletions styles/Typo.css
Original file line number Diff line number Diff line change
Expand Up @@ -932,71 +932,75 @@ body.mrna input[type="submit"]:hover {


.h-space-10 {
padding: 0 10px;
padding: 0 10px!important;
}

.h-space-20 {
padding: 0 20px
padding: 0 20px!important;
}

.h-space-30 {
padding: 0 30px;
padding: 0 30px!important;
}

.h-space-40 {
padding: 0 40px;
padding: 0 40px!important;
}

.h-space-50 {
padding: 0 50px;
padding: 0 50px!important;
}

.v-space-10 {
padding: 10px 0;
padding: 10px 0!important;
}

.v-space-20 {
padding: 20px 0;
padding: 20px 0!important;
}

.v-space-30 {
padding: 30px 0;
padding: 30px 0!important;
}

.v-space-40 {
padding: 40px 0;
padding: 40px 0!important;
}

.v-space-50 {
padding: 50px 0;
padding: 50px 0!important;
}

.space-5 {
padding: 5px;
padding: 5px!important;
}

.space-10 {
padding: 10px;
padding: 10px!important;
}

.space-20 {
padding: 20px;
padding: 20px!important;
}

.space-30 {
padding: 30px;
padding: 30px!important;
}

.space-40 {
padding: 40px;
padding: 40px!important;
}

.space-50 {
padding: 50px;
padding: 50px!important;
}

.bg-grey {
background-color: #ededed;
background-color: #ededed!important;
}

.bg-white {
background-color: #fff!important;
}

.grid-2 {
Expand All @@ -1005,6 +1009,10 @@ body.mrna input[type="submit"]:hover {
grid-gap: 2%;
}

.text-normal {
font-weight: normal;
}

.cols-row,
.cols2-row,
.cols3-row {
Expand Down

0 comments on commit 3b29c2e

Please sign in to comment.