feat: platform-agnostic base style

未關閉
#30,898 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
typescript
領域
frontend, mobile

研究方向

首先檢視現有針對 iOS 和 Material 平台的 content、modal、router 與 navigation 元件樣式。比較它們共用的行為與自訂點,接著定義平台無關基礎主題的範圍。需要就合理的預設值、自訂、轉場與手勢達成共識的設計與實作計畫,才能視為完成。

由索引模型根據 Issue 內容生成。

描述

triage
Prerequisites
Describe the Feature Request

tl;dr: Introduce a new minimal "base" style, which is platform-agnostic and more customizable than the current platform-specific styles.

I've been using Ionic for 8 years now in a production app with great success. When liquid glass was announced, my first thought was that this could become a problem for Ionic and other cross-platform frameworks, because they usually have one style per platform, but not per OS version number. If Ionic adjusts to liquid glass, it will be the same style even for devices running anything < iOS 26. Now, Ionic has the problem that it looks like "old iOS" on iOS 26 devices.

However, after using the mess which is called liquid glass, I'm convinced that app developers won't even bother with making their app look Apple-like and rebuilding liquid glass in CSS is a waste of time. Liquid glass is so opinionated that devs might actually go for a more unified style for both Android and iOS just like Flutter apps, which have pixel-perfect matching styles. For React Native, it's similar. While they do have platform-specific styles, big apps try to use their own design system instead of going for that Apple- or Material-specific look. UI libraries like shadcn/ui are on the rise, which give apps a unified look.

Flutter seems to be surprisingly popular, too, even though they don't even give you simple OS-level tools like text selection, copy-paste etc. which you get for free in an Ionic app.

Ionic is still unique, because it gives devs sensible defaults, a great dev experience, good basics like page transitions, modal transitions, gestures, toggles, a router and I love the idea that Ionic components are just Web components. Another framework that tries to mimic liquid glass is KonstaUI, but they lack transitions and gestures. I also thought about creating my own mini-framework that is mostly without styles, but this made me appreciate all of the tiny things that Ionic does right even more (especially transitions, gestures, the whole overscroll/rubberbanding effect etc.)

On modern devices, I don't really see the reason to use Flutter, because why would I need a custom rendering engine if Chrome and Safari can be my rendering engines and I can write HTML/CSS/JS to make true cross-platform apps with a single code base.

The biggest disadvantage of Ionic is that it is hard to customize the theme, partially because the web components use ShadowDOM, partially because "ios" and "md" are deeply entrenched in the framework. What I'd like to see and maybe this is a vision that'd work for the Ionic team, too:

Make a new "base" theme that can easily be customized. Maybe the base theme could have mostly unstyled components or comes only with the bare minimum components to make a SPA feel applike: content, header, modal, router, transitions including all gestures etc.

Anyways, I just wanted to put this out here and hear from people what they think about this.

Describe the Use Case

Apps that want to have more of their own design system without using Material or Liquid Glass.

Describe Preferred Solution

Make content, modal, router, nav have a sensible base style that works on both platforms, make them open so that I could customize transition speeds etc. but still get a great UI out of the box.

Describe Alternatives

Build my own, but then lose access to all the work that went into optimizing the "headless" part of Ionic core components.

Related Code

No response

Additional Information

No response

主要語言
TypeScript
星號
52.8k
分支
13.3k
平均合併
3 天 1 小時
30 天內合併 PR
86

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ionic-team/ionic-framework 的其他 Issue

查看 ionic-team/ionic-framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。