Skip to content

Commit

Permalink
fix(rtl): css 样式变量部分 (#1944)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyatong authored Feb 23, 2024
1 parent 756903a commit 3e4ca73
Show file tree
Hide file tree
Showing 99 changed files with 569 additions and 569 deletions.
6 changes: 3 additions & 3 deletions src/packages/actionsheet/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,23 @@ const ActionSheetDemo = () => {
{translated['84aa6bce']}
</label>
</span>
<div style={{ marginLeft: '10px' }}>{val1}</div>
<div style={{ marginInlineStart: '10px', color: '#999' }}>{val1}</div>
</Cell>
<Cell onClick={() => setIsVisible2(!isVisible2)}>
<span>
<label htmlFor={translated['595d7bb3']}>
{translated['595d7bb3']}
</label>
</span>
<div style={{ marginLeft: '10px' }}>{val2}</div>
<div style={{ marginInlineStart: '10px', color: '#999' }}>{val2}</div>
</Cell>
<Cell onClick={() => setIsVisible3(!isVisible3)}>
<span>
<label htmlFor={translated['0a1a6656']}>
{translated['0a1a6656']}
</label>
</span>
<div style={{ marginLeft: '10px' }}>{val3}</div>
<div style={{ marginInlineStart: '10px', color: '#999' }}>{val3}</div>
</Cell>
<h2>{translated.c3a08064}</h2>
<Cell onClick={() => setIsVisible4(!isVisible4)}>
Expand Down
6 changes: 3 additions & 3 deletions src/packages/actionsheet/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,23 @@ const ActionSheetDemo = () => {
{translated['84aa6bce']}
</label>
</span>
<div style={{ marginLeft: '10px' }}>{val1}</div>
<div style={{ marginInlineStart: '10px', color: '#999' }}>{val1}</div>
</Cell>
<Cell onClick={() => setIsVisible2(!isVisible2)}>
<span>
<label htmlFor={translated['595d7bb3']}>
{translated['595d7bb3']}
</label>
</span>
<div style={{ marginLeft: '10px' }}>{val2}</div>
<div style={{ marginInlineStart: '10px', color: '#999' }}>{val2}</div>
</Cell>
<Cell onClick={() => setIsVisible3(!isVisible3)}>
<span>
<label htmlFor={translated['0a1a6656']}>
{translated['0a1a6656']}
</label>
</span>
<div style={{ marginLeft: '10px' }}>{val3}</div>
<div style={{ marginInlineStart: '10px', color: '#999' }}>{val3}</div>
</Cell>
<h2>{translated.c3a08064}</h2>
<Cell onClick={() => setIsVisible4(!isVisible4)}>
Expand Down
27 changes: 0 additions & 27 deletions src/packages/animate/animate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -304,30 +304,3 @@
animation-iteration-count: infinite;
}
}

[dir='rtl'] .nut-animate,
.nut-rtl .nut-animate {
.nut-animate-twinkle {
&::after,
&::before {
border-radius: calc(60 / 2) * 1px;
right: auto;
left: 50%;
margin-right: 0;
margin-left: calc(-60 / 2) * 1px;
}
}

.nut-animate-flicker {
&::after {
left: auto;
right: 0;
background-image: linear-gradient(
-106deg,
rgba(232, 224, 255, 0) 24%,
#e8e0ff 91%
);
transform: skewX(20deg);
}
}
}
5 changes: 0 additions & 5 deletions src/packages/audio/audio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
background: $white;
border-radius: 50%;
box-shadow: 0 0 8px $color-text-disabled;

.nut-icon-am-rotate {
transform: rotate((360));
animation-timing-function: ease-in-out;
}
}

.nut-audio-icon-stop {
Expand Down
12 changes: 1 addition & 11 deletions src/packages/avatar/demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,10 @@
border-radius: 0;

& > div {
margin-right: 30px;
margin-inline-end: 30px;
}
}
}
.demo-avatar {
color: #fff;
}

[dir='rtl'] .avatar-demo,
.nut-rtl .avatar-demo {
.nut-cell {
& > div {
margin-right: 0px;
margin-left: 30px;
}
}
}
4 changes: 2 additions & 2 deletions src/packages/avatar/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ const AvatarDemo = () => {
<Cell>
<Avatar
size="normal"
style={{ marginRight: 0 }}
style={{ marginInlineEnd: 0 }}
src="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png"
/>
<div style={{ marginLeft: '10px' }}>
<div style={{ marginInlineStart: '10px' }}>
<div style={{ fontSize: '16px' }}>{translated.f645fc67}</div>
<div style={{ fontSize: '12px' }}>{translated.f645fc68}</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/packages/avatarcropper/avatarcropper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
left: auto;
right: 0;
}

&-popup {
left: auto;
right: 0;
Expand All @@ -138,7 +137,6 @@
&-highlight {
left: auto;
right: 0;

.highlight {
left: auto;
right: 50%;
Expand Down
21 changes: 11 additions & 10 deletions src/packages/backtop/backtop.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ export const BackTop: FunctionComponent<
})
}

const styles = style
? {
zIndex,
...style,
}
: {
right: '10px',
bottom: '20px',
zIndex,
}
const styles =
Object.keys(style || {}).length !== 0
? {
zIndex,
...style,
}
: {
right: '10px',
bottom: '20px',
zIndex,
}

return (
<div
Expand Down
28 changes: 11 additions & 17 deletions src/packages/backtop/backtop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ export const BackTop: FunctionComponent<
}

const classPrefix = 'nut-backtop'

const [backTop, SetBackTop] = useState(false)
const [scrollTop, SetScrollTop] = useState(0)
let startTime = 0
const scrollEl: any = useRef<any>(null)
// 初始化
useEffect(() => {
init()

return () => removeEventListener()
}, [])

Expand All @@ -72,7 +69,6 @@ export const BackTop: FunctionComponent<
SetScrollTop(top)
}
const showBtn = top >= threshold

SetBackTop(showBtn)
}

Expand Down Expand Up @@ -101,36 +97,34 @@ export const BackTop: FunctionComponent<
window.cancelAnimationFrame = window.webkitCancelAnimationFrame
}

// 监听事件
function addEventListener() {
scrollEl.current?.addEventListener('scroll', scrollListener, false)
scrollEl.current?.addEventListener('resize', scrollListener, false)
}

// 移除监听事件
function removeEventListener() {
scrollEl.current?.removeEventListener('scroll', scrollListener, false)
scrollEl.current?.removeEventListener('resize', scrollListener, false)
}

// 返回顶部点击事件
const goTop = (e: MouseEvent<HTMLDivElement>) => {
onClick && onClick(e)
const otime = +new Date()
startTime = otime
duration > 0 ? scrollAnimation() : scroll()
}

const styles = style
? {
zIndex,
...style,
}
: {
right: '10px',
bottom: '20px',
zIndex,
}
const styles =
Object.keys(style || {}).length !== 0
? {
zIndex,
...style,
}
: {
right: '10px',
bottom: '20px',
zIndex,
}

return (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/packages/backtop/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const BackTopDemo = () => {
threshold={200}
style={{
bottom: '50px',
right: '20px',
insetInlineEnd: '20px',
}}
onClick={handleClick}
>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/backtop/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const BackTopDemo = () => {
threshold={200}
style={{
bottom: '50px',
right: '20px',
insetInlineEnd: '20px',
}}
onClick={handleClick}
target="target"
Expand Down
7 changes: 7 additions & 0 deletions src/packages/badge/badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@
right: auto;
left: -15%;
}

&-content {
transform: var(
--nutui-badge-content-transform,
translateY(-50%) translateX(-100%)
);
}
}
Empty file removed src/packages/badge/demo.scss
Empty file.
Loading

0 comments on commit 3e4ca73

Please sign in to comment.