From 589e221f2d4f311ef3f55623e9b064158541b66c Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sat, 7 Mar 2026 20:22:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=96=87=E7=AB=A0=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E7=9A=84=E4=BD=BF=E7=94=A8=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archive.php | 106 ++++++++----------------------- assets/css/content.css | 140 +++++++++++++++++++---------------------- 2 files changed, 92 insertions(+), 154 deletions(-) diff --git a/archive.php b/archive.php index 8712de3..431dc05 100644 --- a/archive.php +++ b/archive.php @@ -10,8 +10,6 @@ $is_itstudio_content_page = $is_itstudio_news_page || $is_itstudio_notice_page; true, - 'column' => 'post_date', - ); - if ($date_from_valid !== '') { - $range['after'] = $date_from_valid; - } - if ($date_to_valid !== '') { - $range['before'] = $date_to_valid; - } - $date_query[] = $range; -} - if ($tag_slug !== '') { $resolved_tag = get_term_by('slug', $tag_slug, 'post_tag'); if (!($resolved_tag instanceof WP_Term)) { @@ -83,9 +58,6 @@ if ($keyword !== '') { $list_query_args['itstudio_archive_extend_search'] = true; $list_query_args['itstudio_archive_keyword'] = $keyword; } -if (!empty($date_query)) { - $list_query_args['date_query'] = $date_query; -} if ($tag_slug !== '') { $list_query_args['tax_query'] = array( array( @@ -137,55 +109,34 @@ $featured_ids = array_slice(array_values(array_unique($featured_ids)), 0, 4);
-
- - - -
- - - -
- -
-
@@ -279,8 +230,6 @@ $featured_ids = array_slice(array_values(array_unique($featured_ids)), 0, 4); 'add_args' => array_filter( array( 'q' => $keyword, - 'date_from' => $date_from, - 'date_to' => $date_to, 'tag' => $tag_slug, ), static function ($value) { @@ -412,4 +361,3 @@ $featured_ids = array_slice(array_values(array_unique($featured_ids)), 0, 4); - diff --git a/assets/css/content.css b/assets/css/content.css index 031a887..b9107f5 100644 --- a/assets/css/content.css +++ b/assets/css/content.css @@ -636,38 +636,50 @@ .news-archive-tools { margin-top: 14px; - display: grid; - grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); - gap: 12px; - align-items: end; + display: block; } -.news-archive-filter-form { +.news-archive-search { display: grid; - grid-template-columns: minmax(0, 1fr) auto; + grid-template-columns: minmax(280px, 560px) auto; gap: 8px; align-items: end; + justify-content: end; } -.news-archive-filter-fields { +.news-archive-search-controls { display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); + grid-template-columns: minmax(0, 1fr) minmax(116px, 170px); gap: 8px; } -.news-archive-filter-field { - display: grid; - gap: 4px; +.news-archive-search input[type="search"] { + appearance: none; + -webkit-appearance: none; + width: 100%; + height: 36px; + border: 1px solid var(--border-default); + border-radius: var(--radius-sm); + background: color-mix(in srgb, var(--bg-card) 90%, transparent); + color: var(--text-primary); + padding: 0 11px; + font-size: 0.88rem; } -.news-archive-filter-field span { - font-size: 0.72rem; - color: var(--text-secondary); - font-family: var(--font-mono); +.news-archive-search input[type="search"]::-webkit-search-decoration, +.news-archive-search input[type="search"]::-webkit-search-cancel-button, +.news-archive-search input[type="search"]::-webkit-search-results-button, +.news-archive-search input[type="search"]::-webkit-search-results-decoration { + -webkit-appearance: none; + appearance: none; } -.news-archive-filter-form input[type="date"], -.news-archive-filter-form select { +.news-archive-search input[type="search"]:focus { + outline: none; + border-color: var(--color-primary); +} + +.news-archive-search select { width: 100%; height: 36px; border: 1px solid var(--border-default); @@ -678,48 +690,7 @@ font-size: 0.85rem; } -.news-archive-filter-form input[type="date"]:focus, -.news-archive-filter-form select:focus { - outline: none; - border-color: var(--color-primary); -} - -.news-archive-filter-form button { - height: 36px; - padding: 0 12px; - border: 1px solid var(--border-default); - border-radius: var(--radius-sm); - background: transparent; - color: var(--text-primary); - font-size: 0.86rem; - font-weight: 600; - cursor: pointer; -} - -.news-archive-filter-form button:hover { - border-color: var(--color-primary); - color: var(--color-primary); -} - -.news-archive-search { - display: grid; - grid-template-columns: 1fr auto; - gap: 8px; - align-self: end; -} - -.news-archive-search input[type="search"] { - width: 100%; - height: 36px; - border: 1px solid var(--border-default); - border-radius: var(--radius-sm); - background: transparent; - color: var(--text-primary); - padding: 0 11px; - font-size: 0.88rem; -} - -.news-archive-search input[type="search"]:focus { +.news-archive-search select:focus { outline: none; border-color: var(--color-primary); } @@ -741,20 +712,42 @@ color: var(--color-primary); } -html:not([data-theme="dark"]) .news-archive-filter-form input[type="date"], -html:not([data-theme="dark"]) .news-archive-filter-form select { +html:not([data-theme="dark"]) .news-archive-search select { color-scheme: light; } -[data-theme="dark"] .news-archive-filter-form input[type="date"], -[data-theme="dark"] .news-archive-filter-form select { +html:not([data-theme="dark"]) .news-archive-search input[type="search"] { + color-scheme: light; +} + +[data-theme="dark"] .news-archive-search input[type="search"] { + background: color-mix(in srgb, var(--bg-card) 92%, #000 8%) !important; + color: var(--text-primary) !important; + -webkit-text-fill-color: var(--text-primary) !important; + color-scheme: dark; +} + +[data-theme="dark"] .news-archive-search input[type="search"]:-webkit-autofill, +[data-theme="dark"] .news-archive-search input[type="search"]:-webkit-autofill:hover, +[data-theme="dark"] .news-archive-search input[type="search"]:-webkit-autofill:focus, +[data-theme="dark"] .news-archive-search input[type="search"]:autofill { + -webkit-text-fill-color: var(--text-primary) !important; + -webkit-box-shadow: 0 0 0 1000px color-mix(in srgb, var(--bg-card) 92%, #000 8%) inset !important; + box-shadow: 0 0 0 1000px color-mix(in srgb, var(--bg-card) 92%, #000 8%) inset !important; + background: color-mix(in srgb, var(--bg-card) 92%, #000 8%) !important; + border-color: var(--border-default) !important; + caret-color: var(--text-primary) !important; + transition: background-color 9999s ease-out 0s !important; +} + +[data-theme="dark"] .news-archive-search select { background: color-mix(in srgb, var(--bg-card) 92%, #000 8%); color: var(--text-primary); color-scheme: dark; } -[data-theme="dark"] .news-archive-filter-form select option, -[data-theme="dark"] .news-archive-filter-form select optgroup { +[data-theme="dark"] .news-archive-search select option, +[data-theme="dark"] .news-archive-search select optgroup { background-color: #0f1724; color: var(--text-primary); } @@ -1073,21 +1066,18 @@ html:not([data-theme="dark"]) .news-archive-filter-form select { margin-top: 14px; } - .news-archive-tools { - grid-template-columns: 1fr; - } - - .news-archive-filter-form { - grid-template-columns: 1fr; + .news-archive-search { + grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; } - .news-archive-filter-fields { - grid-template-columns: 1fr; + .news-archive-search-controls { + grid-template-columns: minmax(0, 1fr) minmax(106px, 132px); } - .news-archive-search { - grid-template-columns: 1fr; + .news-archive-search button { + min-width: 62px; + padding: 0 10px; } .news-story {