From c493f0d22ab62fe1be9c378b726fd15f38306feb Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 8 May 2024 10:32:33 +0300 Subject: [PATCH] Calculations for the icon field inputs --- components/lib/base/style/BaseStyle.js | 8 ++++---- components/lib/iconfield/style/IconFieldStyle.js | 10 +++++----- components/lib/select/style/SelectStyle.js | 2 -- components/lib/themes/aura/index.js | 1 + components/lib/themes/lara/index.js | 1 + 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/lib/base/style/BaseStyle.js b/components/lib/base/style/BaseStyle.js index 1d122fd21..3c1c8cb8f 100644 --- a/components/lib/base/style/BaseStyle.js +++ b/components/lib/base/style/BaseStyle.js @@ -151,16 +151,16 @@ const theme = ({ dt }) => ` } .p-text-secondary { - color: #64748b; + color: ${dt('text.muted.color')}; } .pi { - font-size: 1rem; + font-size: ${dt('icon.size')}; } .p-icon { - width: 1rem; - height: 1rem; + width: ${dt('icon.size')}; + height: ${dt('icon.size')}; } .p-link { diff --git a/components/lib/iconfield/style/IconFieldStyle.js b/components/lib/iconfield/style/IconFieldStyle.js index 378a3ce58..66394f300 100644 --- a/components/lib/iconfield/style/IconFieldStyle.js +++ b/components/lib/iconfield/style/IconFieldStyle.js @@ -8,24 +8,24 @@ const theme = ({ dt }) => ` .p-inputicon { position: absolute; top: 50%; - margin-top: -.5rem; + margin-top: calc(-1 * (${dt('icon.size')} / 2)); color: ${dt('iconfield.icon.color')}; } .p-iconfield .p-inputicon:first-child { - left: 0.75rem; + left: ${dt('form.field.padding.x')}; } .p-iconfield .p-inputicon:last-child { - right: 0.75rem; + right: ${dt('form.field.padding.x')}; } .p-iconfield .p-inputtext:last-child { - padding-left: 2.5rem; + padding-left: calc((${dt('form.field.padding.x')} * 2) + ${dt('icon.size')}); } .p-iconfield .p-inputtext:first-child { - padding-right: 2.5rem; + padding-right:calc((${dt('form.field.padding.x')} * 2) + ${dt('icon.size')}); } `; diff --git a/components/lib/select/style/SelectStyle.js b/components/lib/select/style/SelectStyle.js index dae608a80..2d9841811 100644 --- a/components/lib/select/style/SelectStyle.js +++ b/components/lib/select/style/SelectStyle.js @@ -119,8 +119,6 @@ input.p-select-label { .p-select-filter { width: 100%; - padding-right: 1.75rem; - margin-right: -1.75rem; } .p-select-list-container { diff --git a/components/lib/themes/aura/index.js b/components/lib/themes/aura/index.js index f3717631c..61783ef4a 100644 --- a/components/lib/themes/aura/index.js +++ b/components/lib/themes/aura/index.js @@ -126,6 +126,7 @@ export default { offset: '2px', shadow: 'none' }, + iconSize: '1rem', anchorGutter: '2px', primary: { 50: '{emerald.50}', diff --git a/components/lib/themes/lara/index.js b/components/lib/themes/lara/index.js index 946ee69e5..dbf99b38b 100644 --- a/components/lib/themes/lara/index.js +++ b/components/lib/themes/lara/index.js @@ -125,6 +125,7 @@ export default { color: 'transparent', offset: '0' }, + iconSize: '1rem', anchorGutter: '2px', primary: { 50: '{emerald.50}',