From 8b07d0201ee57838dc3f65a7b5f172d157b5de0c Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Thu, 23 May 2024 08:36:15 +0000 Subject: [PATCH 1/5] Update gitlab CI file to avoid arm runner that keeps failing certain resource-intensive tasks --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b4452d5..25e499c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,8 @@ lint: test: stage: test + tags: + - amd64 variables: APT_CACHE_DIR: apt-cache script: @@ -54,6 +56,8 @@ test: build: stage: build + tags: + - amd64 script: - yarn - npm run build From 5810f6f4318e65d51f004d89259c37182945c422 Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Thu, 23 May 2024 08:38:17 +0000 Subject: [PATCH 2/5] changelog --- changelog.d/ci-runner.skip | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/ci-runner.skip diff --git a/changelog.d/ci-runner.skip b/changelog.d/ci-runner.skip new file mode 100644 index 00000000..ad4b79d5 --- /dev/null +++ b/changelog.d/ci-runner.skip @@ -0,0 +1 @@ +stop using that one runner for intensive tasks \ No newline at end of file From 3da6f8a2d165e9e0ed3d55c1fe99ee3441f08bb8 Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 31 May 2024 09:38:42 -0400 Subject: [PATCH 3/5] Ensure selection text color has enough contrast --- changelog.d/no-preserve-selection-color.fix | 1 + src/components/root.style.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/no-preserve-selection-color.fix diff --git a/changelog.d/no-preserve-selection-color.fix b/changelog.d/no-preserve-selection-color.fix new file mode 100644 index 00000000..669e744c --- /dev/null +++ b/changelog.d/no-preserve-selection-color.fix @@ -0,0 +1 @@ +Ensure selection text color has enough contrast diff --git a/src/components/root.style.js b/src/components/root.style.js index 3e840a52..f9bdf16e 100644 --- a/src/components/root.style.js +++ b/src/components/root.style.js @@ -37,7 +37,7 @@ export default { // Selection colors '--selectionBackground': 'color | --accent', - '--selectionText': 'color | $textColor(--accent, --text)' + '--selectionText': 'color | $textColor(--accent, --text, no-preserve)' } } ] From dc37c7b28b2142227f73a36acc27a7ac77c7e59a Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 31 May 2024 14:33:44 -0400 Subject: [PATCH 4/5] Fix Themes v3 not working on Safari --- changelog.d/themesv3-on-safari.fix | 1 + index.html | 2 + src/services/style_setter/style_setter.js | 69 ++++++++++++++----- src/services/theme_data/iss_utils.js | 6 +- .../theme_data/theme_data_3.service.js | 4 +- 5 files changed, 62 insertions(+), 20 deletions(-) create mode 100644 changelog.d/themesv3-on-safari.fix diff --git a/changelog.d/themesv3-on-safari.fix b/changelog.d/themesv3-on-safari.fix new file mode 100644 index 00000000..af767b3a --- /dev/null +++ b/changelog.d/themesv3-on-safari.fix @@ -0,0 +1 @@ +Fix Themes v3 on Safari not working diff --git a/index.html b/index.html index e790fb57..6d9c4ce5 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,8 @@ + + diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 369d2c9f..83faa0b3 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -6,6 +6,45 @@ import { getCssRules } from '../theme_data/css_utils.js' import { defaultState } from '../../modules/config.js' import { chunk } from 'lodash' +// On platforms where this is not supported, it will return undefined +// Otherwise it will return an array +const supportsAdoptedStyleSheets = !!document.adoptedStyleSheets + +const createStyleSheet = (id) => { + if (supportsAdoptedStyleSheets) { + return { + el: null, + sheet: new CSSStyleSheet(), + rules: [] + } + } + + const el = document.getElementById(id) + // Clear all rules in it + for (let i = el.sheet.cssRules.length - 1; i >= 0; --i) { + el.sheet.deleteRule(i) + } + + return { + el, + sheet: el.sheet, + rules: [] + } +} + +const EAGER_STYLE_ID = 'pleroma-eager-styles' +const LAZY_STYLE_ID = 'pleroma-lazy-styles' + +const adoptStyleSheets = (styles) => { + if (supportsAdoptedStyleSheets) { + document.adoptedStyleSheets = styles.map(s => s.sheet) + } + // Some older browsers do not support document.adoptedStyleSheets. + // In this case, we use the