NativeScript / NativeScript/NativeScript

TabView styling and css inheritance

未關閉
#5,803 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

enhancement feature tab-view
主要語言
TypeScript
星號
25.7k
分支
1.7k
平均合併
1 天 5 小時
30 天內合併 PR
35

描述

Problem: There are no separate elements for the tab content and the tab strip item. The TabViewItem element wraps both. This breaks css inheritance - the css is applied to both content and tab strip, but you can't override the css separately.

There are also some discrepancies between properties and between platforms:

  • font-size and text-transform have native implementations on TabViewItem, color doesn't. There is however tab-text-color which applies color to all tab strip items.
  • text-transform is for some reason not an inherited property
  • font-size is hard coded for iOS TabViewItems to 10.

Proposed solution:
As a rule I think inherited css properties shouldn't have implementations on elements that are not separately represented in the mark up.

  • Make text-transform inherited as per CSS spec.
  • Remove font-size and text-transform from TabViewItem.
  • Introduce new properties in their place on both TabView and TabViewItem tab-text-font-size and tab-text-transform.
  • Optionally introduce more font properties, e.g. tab-text-font, tab-text-font-style, tab-text-font-family.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

首先定位 TabView 和 TabViewItem 的實作及其平台特定的樣式程式碼。比較 iOS 和 Android 上目前的繼承機制與原生屬性行為,然後檢查現有的 tab-text-color 是如何公開的。完成的標準是:繼承的 text-transform 按照 CSS 的規定運作,獨立的分頁文字屬性涵蓋所提議的字型大小和轉換行為,並且平台差異得到解決。

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

評估

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

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

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