From b94d91e6771d6e9ab9ff1b18753b2fd4cdebf9b2 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Thu, 28 Mar 2024 14:26:59 +0000 Subject: [PATCH] Theming API: Refactor on internal CSS variables --- components/lib/base/style/BaseStyle.js | 4 ++-- components/lib/confirmpopup/ConfirmPopup.vue | 3 ++- components/lib/knob/BaseKnob.vue | 7 +++--- components/lib/knob/Knob.d.ts | 6 ++--- components/lib/overlaypanel/OverlayPanel.vue | 3 ++- components/lib/speeddial/SpeedDial.vue | 17 +++++++------- components/lib/themes/helpers/dt.js | 22 ++++++++++++++++--- .../primeone/base/confirmpopup/index.js | 2 +- .../primeone/base/overlaypanel/index.js | 2 +- components/lib/utils/DomHandler.js | 10 +++++---- 10 files changed, 49 insertions(+), 27 deletions(-) diff --git a/components/lib/base/style/BaseStyle.js b/components/lib/base/style/BaseStyle.js index dc16cc185..d267eef41 100644 --- a/components/lib/base/style/BaseStyle.js +++ b/components/lib/base/style/BaseStyle.js @@ -1,4 +1,4 @@ -import Theme from 'primevue/themes'; +import Theme, { $dt } from 'primevue/themes'; import { useStyle } from 'primevue/usestyle'; import { ObjectUtils } from 'primevue/utils'; @@ -21,7 +21,7 @@ const css = ` .p-overflow-hidden { overflow: hidden; - padding-right: var(--scrollbar-width); + padding-right: ${$dt('scrollbar.width')}; } `; diff --git a/components/lib/confirmpopup/ConfirmPopup.vue b/components/lib/confirmpopup/ConfirmPopup.vue index d39eb3cb4..bae6f89eb 100644 --- a/components/lib/confirmpopup/ConfirmPopup.vue +++ b/components/lib/confirmpopup/ConfirmPopup.vue @@ -63,6 +63,7 @@ import ConfirmationEventBus from 'primevue/confirmationeventbus'; import FocusTrap from 'primevue/focustrap'; import OverlayEventBus from 'primevue/overlayeventbus'; import Portal from 'primevue/portal'; +import { $dtp } from 'primevue/themes'; import { ConnectedOverlayScrollHandler, DomHandler, ZIndexUtils } from 'primevue/utils'; import BaseConfirmPopup from './BaseConfirmPopup.vue'; @@ -203,7 +204,7 @@ export default { arrowLeft = targetOffset.left - containerOffset.left; } - this.container.style.setProperty('--overlayArrowLeft', `${arrowLeft}px`); + this.container.style.setProperty($dtp('overlay.arrow.left').name, `${arrowLeft}px`); if (containerOffset.top < targetOffset.top) { this.container.setAttribute('data-p-confirm-popup-flipped', 'true'); diff --git a/components/lib/knob/BaseKnob.vue b/components/lib/knob/BaseKnob.vue index 8abe5490f..ea3c095e4 100644 --- a/components/lib/knob/BaseKnob.vue +++ b/components/lib/knob/BaseKnob.vue @@ -1,6 +1,7 @@