tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.08k stars 1.67k forks source link

Tracking issue for RTL supporting. #97

Open 07akioni opened 3 years ago

07akioni commented 3 years ago

Overview

RTL(Right to Left) support is a very import feature for the component library. However it'll take great efforts to fulfill the feature since all of the components need to implement extra styles, thus we need your help to achieve the goal.

We've add experimental RTL feature for n-button, n-tag, n-page-header and n-card. If you are interested in contributing to the RTL feature, please reference those components.

You can find the example in the following files.

Here are some discussion about tech detail about implementation.

In general, Naive UI has an internal useRtl composable to mount & update rtl style on demand. It accepts RTL styles passed from n-config-provider and takes adventage of the style.

The component that supports RTL has a style file in component-name/styles/rtl.ts, which exports { name: 'ComponentName', style: CssRenderStyle }.

Components

Here are some components in need RTL support.If you intresting in it,feel free to commont.We will convert it to issue for you,then you can work on it.

Sepush commented 2 years ago

If you are first time to use tacking issue check our previous practice here https://github.com/TuSimple/naive-ui/issues/1842

jahnli commented 1 year ago

breadcrumb

vxow commented 1 year ago

@07akioni 很多样式用margin写的,建议改为flex的gap,这样rtl就不用额外转换样式了

devhus commented 1 year ago

How to enable RTL for these components ?

alphaelf commented 6 months ago

add button component to tasks too, when use icon in button, margin-left: 0; must change to margin-right: 0; in class .n-button__icon

hnasher-immap commented 2 months ago

when enabling selection in columns for NDatableTable, the options does not show when the page direction is RTL. { type: "selection", options:["all", "none"] }