Removed empty spaces shown when language suppression used (#3327)

# Description of Changes

Please provide a summary of the changes, including:

- What was changed
- Why the change was made
- Any challenges encountered

Closes #3319

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [x] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

#### Old

![image](https://github.com/user-attachments/assets/f038b13e-0f6b-4c11-b778-2f1adb6ace57)


#### New

![{6BA642CB-6E74-4B7E-B87E-3F100759042B}](https://github.com/user-attachments/assets/29e2c507-54b3-4ab0-9792-46e013691f4c)


![{EF015A80-C4FE-4731-BDDE-36D74A66E471}](https://github.com/user-attachments/assets/82b11260-9744-40c2-b340-3eb17f4d779e)


### Testing (if applicable)

- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
This commit is contained in:
ConnorYoh 2025-04-10 21:39:42 +01:00 committed by GitHub
parent 2d646c1e18
commit 7fa302f322
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 35 additions and 9 deletions

View File

@ -29,7 +29,7 @@ ext {
} }
group = "stirling.software" group = "stirling.software"
version = "0.45.3" version = "0.45.4"
java { java {
// 17 is lowest but we support and recommend 21 // 17 is lowest but we support and recommend 21

View File

@ -89,6 +89,22 @@
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Auto-fill columns, with a minimum width of 180px */ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Auto-fill columns, with a minimum width of 180px */
} }
.scalable-languages-container:not(:has(> :nth-child(4))) .lang-dropdown-item-wrapper:last-child {
border: 0px !important
}
.scalable-languages-container:has(> *:nth-child(1)) {
--count: 1;
}
.scalable-languages-container:has(> *:nth-child(2)) {
--count: 2;
}
.scalable-languages-container:has(> *:nth-child(3)) {
--count: 3;
}
html[dir="ltr"] .lang-dropdown-item-wrapper { html[dir="ltr"] .lang-dropdown-item-wrapper {
border-right: 2px solid var(--md-nav-color-on-seperator); border-right: 2px solid var(--md-nav-color-on-seperator);
} }
@ -99,8 +115,8 @@ html[dir="rtl"] .lang-dropdown-item-wrapper {
/* Responsive adjustments */ /* Responsive adjustments */
@media (min-width: 1200px){ @media (min-width: 1200px){
.lang_dropdown-mw{ .lang-dropdown-item-wrapper .dropdown-item {
min-width: 800px min-width: 200px
} }
} }
@ -108,7 +124,9 @@ html[dir="rtl"] .lang-dropdown-item-wrapper {
.scalable-languages-container { .scalable-languages-container {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }
.scalable-languages-container:not(:has(> :nth-child(2))){
grid-template-columns: repeat(var(--count), 1fr) !important;
}
.scalable-languages-container .lang-dropdown-item-wrapper:nth-child(2n) { .scalable-languages-container .lang-dropdown-item-wrapper:nth-child(2n) {
border: 0px border: 0px
} }
@ -118,15 +136,23 @@ html[dir="rtl"] .lang-dropdown-item-wrapper {
.scalable-languages-container { .scalable-languages-container {
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
} }
.scalable-languages-container:not(:has(> :nth-child(3))){
grid-template-columns: repeat(var(--count), 1fr) !important;
}
.scalable-languages-container .lang-dropdown-item-wrapper:nth-child(3n) { .scalable-languages-container .lang-dropdown-item-wrapper:nth-child(3n) {
border: 0px border: 0px
}
} }
}
@media (min-width: 901px) { @media (min-width: 901px) {
.scalable-languages-container { .scalable-languages-container {
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
} }
.scalable-languages-container:not(:has(> :nth-child(4))){
grid-template-columns: repeat(var(--count), 1fr) !important;
}
.scalable-languages-container .lang-dropdown-item-wrapper:nth-child(4n) { .scalable-languages-container .lang-dropdown-item-wrapper:nth-child(4n) {
border: 0px border: 0px
} }
@ -215,13 +241,13 @@ span.icon-text::after {
.dropdown-menu.scrollable-y { .dropdown-menu.scrollable-y {
overflow-y: scroll; overflow-y: scroll;
height: 360px; max-height: 360px;
} }
/* Dropdown Scrollbar*/ /* Dropdown Scrollbar*/
.scrollable-y { .scrollable-y {
overflow-y: scroll; overflow-y: scroll;
height: 190px; max-height: 190px;
overscroll-behavior: contain; overscroll-behavior: contain;
} }

View File

@ -1,6 +1,6 @@
<th:block th:fragment="languageEntry(code, name)"> <th:block th:fragment="languageEntry(code, name)">
<div class="lang-dropdown-item-wrapper"> <div th:if="${code} == 'en_GB' or ${#lists.isEmpty(@languages) or #lists.contains(@languages, code)}" class="lang-dropdown-item-wrapper">
<a th:if="${code} == 'en_GB' or ${#lists.isEmpty(@languages) or #lists.contains(@languages, code)}" <a
class="dropdown-item lang_dropdown-item" href="" th:data-bs-language-code="@{${code}}" th:text="${name}"> class="dropdown-item lang_dropdown-item" href="" th:data-bs-language-code="@{${code}}" th:text="${name}">
</a> </a>
</div> </div>