Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(slider,avatar,dialog): wc style split from common #173

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/avatar/style/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { css, globalCSS } from 'omi';

import avatarStyle from '../../_common/style/web/components/avatar/_index.less';
import wcStyles from './wc.less';

export const styleSheet = css`
${avatarStyle}
${wcStyles}
`;

globalCSS(styleSheet);
26 changes: 26 additions & 0 deletions src/avatar/style/wc.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@import "../../_common/style/web/base.less";
@import "../../_common/style/web/components/avatar/_mixin.less";

// for web-component
.@{prefix}-avatar-group {
&.@{prefix}-avatar--offset-right {
& @{prefix}-avatar-light-dom {
&:not(:last-child) {
.avatar-group-offset-right(@avatar-group-offset-medium);
&.@{prefix}-size-s {
.avatar-group-offset-right(@avatar-group-offset-small);
}
&.@{prefix}-size-l {
.avatar-group-offset-right(@avatar-group-offset-large);
}
}
}
}
&.@{prefix}-avatar--offset-left {
& @{prefix}-avatar-light-dom {
&:not(:first-child) {
.avatar-group-size--left();
}
}
}
}
2 changes: 2 additions & 0 deletions src/dialog/style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { css, globalCSS } from 'omi';
// 为了做主题切换
import styles from '../../_common/style/web/components/dialog/_index.less';
import dialogStyles from './dialog.less';
import wcStyles from './wc.less';

export const styleSheet = css`
${styles}
${dialogStyles}
${wcStyles}
`;

globalCSS(styleSheet);
41 changes: 41 additions & 0 deletions src/dialog/style/wc.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import "../../_common/style/web/base.less";
@import "../../_common/style/web/components/dialog/_var.less";

// for web-component
.@{prefix}-dialog {
// icon theme
t-icon-info-circle.@{prefix}-is-info {
color: @dialog-info-icon-color;
}

t-icon-check-circle.@{prefix}-is-success {
color: @dialog-success-icon-color;
}

t-icon-error-circle.@{prefix}-is-warning {
color: @dialog-warning-icon-color;
}

t-icon-error-circle.@{prefix}-is-error {
color: @dialog-error-icon-color;
}

&__header {
t-icon-check-circle,
t-icon-info-circle,
t-icon-error-circle {
font-size: @dialog-icon-size;
display: inline-flex;
align-items: center;
margin-right: @dialog-header-icon-margin-right;
flex-shrink: 0;
}
}

&__footer {
.@{prefix}-button + .@{prefix}-button,
.@{prefix}-dialog__button + .@{prefix}-dialog__button {
margin-left: @dialog-footer-button-margin-left;
}
}
}
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ export * from './tag-input';
export * from './textarea';
export * from './tooltip';
export * from './upload';
export * from './vue';
export * from './watermark';
1 change: 0 additions & 1 deletion src/list/style/wc.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

@import "../../_common/style/web/base.less";
@import "../../_common/style/web/components/list/_var.less";

Expand Down
2 changes: 2 additions & 0 deletions src/slider/style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { css, globalCSS } from 'omi';

// 为了做主题切换
import styles from '../../_common/style/web/components/slider/_index.less';
import wcStyles from './wc.less';

export const styleSheet = css`
${styles}
${wcStyles}
`;

globalCSS(styleSheet);
19 changes: 19 additions & 0 deletions src/slider/style/wc.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import "../../_common/style/web/base.less";
@import "../../_common/style/web/components/slider/_var.less";

.@{prefix}-slider--vertical .@{prefix}-slider__button-wrapper,
.@{prefix}-slider__button-wrapper--vertical {
top: auto;
position: absolute;
z-index: 2;
left: 50%;
transform: translate(-50%, 50%);
background-color: transparent;
text-align: center;
user-select: none;
line-height: normal;
outline: none;
cursor: pointer;
display: flex;
align-items: center;
}
Loading