Remove fomantic dimmer module (#30723)

Tested extensively using modal which is the only dependant.
This commit is contained in:
silverwind 2024-04-29 16:49:50 +02:00 committed by GitHub
parent e80466f734
commit a21ca9b5a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 62 additions and 1116 deletions

View File

@ -680,10 +680,6 @@ input:-webkit-autofill:active,
box-shadow: 0 6px 18px var(--color-shadow) !important;
}
.ui.dimmer {
background: var(--color-overlay-backdrop);
}
.ui.dropdown .menu > .header {
font-size: 0.8em;
}

View File

@ -16,6 +16,7 @@
@import "./modules/table.css";
@import "./modules/card.css";
@import "./modules/checkbox.css";
@import "./modules/dimmer.css";
@import "./modules/modal.css";
@import "./modules/select.css";

View File

@ -0,0 +1,30 @@
/* These are the remnants of the fomantic dimmer module */
.ui.dimmer {
position: fixed;
display: none;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--color-overlay-backdrop);
opacity: 0;
z-index: 1000;
overflow-y: auto;
justify-content: center;
padding: 8px 0;
animation-name: fadein;
animation-duration: .2s;
user-select: none;
}
.ui.active.dimmer {
display: flex;
opacity: 1;
}
.ui.dimmer > * {
position: static;
margin-top: auto !important;
margin-bottom: auto !important;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,6 @@
"admin": false,
"components": [
"api",
"dimmer",
"dropdown",
"form",
"modal",

View File

@ -5,6 +5,7 @@ import {initAriaFormFieldPatch} from './fomantic/form.js';
import {initAriaDropdownPatch} from './fomantic/dropdown.js';
import {initAriaModalPatch} from './fomantic/modal.js';
import {initFomanticTransition} from './fomantic/transition.js';
import {initFomanticDimmer} from './fomantic/dimmer.js';
import {svg} from '../svg.js';
export const fomanticMobileScreen = window.matchMedia('only screen and (max-width: 767.98px)');
@ -24,6 +25,7 @@ export function initGiteaFomantic() {
};
initFomanticTransition();
initFomanticDimmer();
initFomanticApiPatch();
// Use the patches to improve accessibility, these patches are designed to be as independent as possible, make it easy to modify or remove in the future.

View File

@ -0,0 +1,29 @@
import $ from 'jquery';
import {queryElemChildren} from '../../utils/dom.js';
export function initFomanticDimmer() {
// stand-in for removed dimmer module
$.fn.dimmer = function (arg0, $el) {
if (arg0 === 'add content') {
const existingDimmer = document.querySelector('body > .ui.dimmer');
if (existingDimmer) {
queryElemChildren(existingDimmer, '*', (el) => el.remove());
this._dimmer = existingDimmer;
} else {
this._dimmer = document.createElement('div');
this._dimmer.classList.add('ui', 'dimmer');
document.body.append(this._dimmer);
}
this._dimmer.append($el[0]);
} else if (arg0 === 'get dimmer') {
return $(this._dimmer);
} else if (arg0 === 'show') {
this._dimmer.classList.add('active');
document.body.classList.add('tw-overflow-hidden');
} else if (arg0 === 'hide') {
this._dimmer.classList.remove('active');
document.body.classList.remove('tw-overflow-hidden');
}
return this;
};
}