refactor: tinymce+表单 校验失败样式

This commit is contained in:
dap 2025-06-05 21:18:36 +08:00
parent 831700660c
commit 006370798b
2 changed files with 35 additions and 4 deletions

View File

@ -241,6 +241,7 @@
"napi", "napi",
"nolebase", "nolebase",
"rollup", "rollup",
"tinymce",
"vitest" "vitest"
] ]
} }

View File

@ -202,10 +202,21 @@ const events = computed(() => {
</template> </template>
<style lang="scss"> <style lang="scss">
/*** @mixin tinymce-valid-fail($color) {
由于modal/drawer的zIndex升级后为2000 .app-tinymce {
这里会造成遮挡 修改为更高的zIndex // tinymce
*/ .tox-tinymce {
border-color: $color;
}
// focus
.tox .tox-edit-area::before {
border-color: $color;
border-right: none;
border-left: none;
}
}
}
.tox.tox-silver-sink.tox-tinymce-aux { .tox.tox-silver-sink.tox-tinymce-aux {
/** 该样式默认为1300的zIndex */ /** 该样式默认为1300的zIndex */
z-index: 2025; z-index: 2025;
@ -218,5 +229,24 @@ const events = computed(() => {
.tox-promotion { .tox-promotion {
display: none; display: none;
} }
/** 保持focus时与primary色一致 */
.tox .tox-edit-area::before {
border-color: hsl(var(--primary));
}
}
// antd
.ant-form-item:has(.ant-form-item-explain-error) {
$error-color: #ff3860;
@include tinymce-valid-fail($error-color);
}
// useVbenForm
.form-valid-error {
$error-color: hsl(var(--destructive));
@include tinymce-valid-fail($error-color);
} }
</style> </style>