From 8964b32fb5673a5ceda14062aafc608633187705 Mon Sep 17 00:00:00 2001 From: sunhao Date: Thu, 14 Dec 2023 16:55:28 +0800 Subject: [PATCH] * zin: refactor widgets with the new zui typography lib. --- lib/zin/wg/detailbody/v1.php | 4 ++-- lib/zin/wg/entitylabel/css/v1.css | 4 ++++ lib/zin/wg/entitylabel/v1.php | 4 ++-- lib/zin/wg/section/v1.php | 6 +++--- lib/zin/wg/sectioncard/v1.php | 2 +- lib/zin/wg/tabledata/css/v1.css | 2 +- lib/zin/wg/tabledata/v1.php | 2 +- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/zin/wg/detailbody/v1.php b/lib/zin/wg/detailbody/v1.php index e0e31dafca..80775fbdea 100644 --- a/lib/zin/wg/detailbody/v1.php +++ b/lib/zin/wg/detailbody/v1.php @@ -41,7 +41,7 @@ class detailBody extends wg set($this->getRestProps()), div ( - setClass('col gap-1 grow'), + setClass('col gap-1 grow min-w-0'), $main, $bottom, empty($floating) ? null : center(setClass('pt-6'), $floating) @@ -65,7 +65,7 @@ class detailBody extends wg setStyle('min-height', '100%'), div ( - setClass('col grow'), + setClass('col grow min-w-0'), $main, $bottom ), diff --git a/lib/zin/wg/entitylabel/css/v1.css b/lib/zin/wg/entitylabel/css/v1.css index 994ac245f5..a7f266971a 100644 --- a/lib/zin/wg/entitylabel/css/v1.css +++ b/lib/zin/wg/entitylabel/css/v1.css @@ -1 +1,5 @@ .entity-label .label {box-shadow: none; border: 1px solid var(--color-gray-300); color: var(--color-gray-700); background: none;} +.entity-title-1 {font-size: 1rem; color: var(--color-gray-900); font-weight: bold;} +.entity-title-2 {font-size: 0.875rem; color: var(--color-gray-900); font-weight: bold;} +.entity-title-3 {color: var(--color-gray-800); font-weight: bold;} +.entity-title-3 {color: var(--color-gray-800);} diff --git a/lib/zin/wg/entitylabel/v1.php b/lib/zin/wg/entitylabel/v1.php index 0c60f8f531..18a6297b4d 100644 --- a/lib/zin/wg/entitylabel/v1.php +++ b/lib/zin/wg/entitylabel/v1.php @@ -65,8 +65,8 @@ class entityLabel extends wg $titlePrefix = $this->prop('titlePrefix'); $titleClass = empty($level) - ? "article-content" - : "article-h$level"; + ? '' + : "entity-title entity-title-$level"; if(empty($href)) return div ( diff --git a/lib/zin/wg/section/v1.php b/lib/zin/wg/section/v1.php index ceb3a4393e..5e4eaeabde 100644 --- a/lib/zin/wg/section/v1.php +++ b/lib/zin/wg/section/v1.php @@ -35,7 +35,7 @@ class section extends wg { return div ( - setClass('article-h1', 'mb-2', 'inline-flex'), + setClass('font-bold text-md', 'mb-2', 'inline-flex'), $required ? h::label ( setClass('form-label required mr-1'), @@ -49,7 +49,7 @@ class section extends wg setClass('flex', 'items-center', 'mb-2'), div ( - setClass('article-h1', 'inline-flex'), + setClass('font-bold text-md', 'inline-flex'), $required ? h::label ( setClass('form-label required mr-1'), @@ -66,7 +66,7 @@ class section extends wg return div ( - setClass('article-content'), + setClass('article'), $useHtml ? html($content) : $content ); diff --git a/lib/zin/wg/sectioncard/v1.php b/lib/zin/wg/sectioncard/v1.php index 13ae3a5c33..f926cd41da 100644 --- a/lib/zin/wg/sectioncard/v1.php +++ b/lib/zin/wg/sectioncard/v1.php @@ -12,7 +12,7 @@ class sectionCard extends wg { return div ( - setClass('article-h4', 'mb-1'), + setClass('h4', 'mb-1'), "[$text]" ); } diff --git a/lib/zin/wg/tabledata/css/v1.css b/lib/zin/wg/tabledata/css/v1.css index f8a92de3f7..a6e0925eb2 100644 --- a/lib/zin/wg/tabledata/css/v1.css +++ b/lib/zin/wg/tabledata/css/v1.css @@ -1,4 +1,4 @@ .table-data {table-layout: fixed;} .table-data th, -.table-data .table-data-th {width: 65px; color: var(--color-gray-600);} +.table-data .table-data-th {width: 65px; color: var(--color-gray-600); border: none} .table-data th.required:before {content: '*'; color: rgba(var(--color-danger-500-rgb),var(--tw-text-opacity)); position: relative; top: 0.25rem; right: 0.25rem;} diff --git a/lib/zin/wg/tabledata/v1.php b/lib/zin/wg/tabledata/v1.php index 4859449f7d..0a7a6cd781 100644 --- a/lib/zin/wg/tabledata/v1.php +++ b/lib/zin/wg/tabledata/v1.php @@ -100,7 +100,7 @@ class tableData extends wg return h::caption ( - setClass('article-h1 text-left mb-2'), + setClass('h1 text-left mb-2'), $title ); }