NativeScript / NativeScript/NativeScript
TabView styling and css inheritance
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 1.7k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 35
Description
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-sizeandtext-transformhave native implementations on TabViewItem,colordoesn't. There is howevertab-text-colorwhich applies color to all tab strip items.text-transformis for some reason not an inherited propertyfont-sizeis 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-transforminherited as per CSS spec. - Remove
font-sizeandtext-transformfrom TabViewItem. - Introduce new properties in their place on both TabView and TabViewItem
tab-text-font-sizeandtab-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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TabView and TabViewItem implementations and their platform-specific styling code. Compare current inheritance and native property behavior across iOS and Android, then check how existing tab-text-color is exposed. Done means inherited text-transform behaves per CSS, separate tab text properties cover the proposed font size and transform behavior, and platform discrepancies are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, typescript
- Domain
- frontend, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100