Commit 780a8a67b874ca1c8d05c2561f88081cc4ec4b28

Authored by Vben
1 parent 96a49ba1

fix: improve login page style

CHANGELOG.zh_CN.md
  1 +## Wip
  2 +
  3 +### 🐛 Bug Fixes
  4 +
  5 +- 登录页样式修复
  6 +
1 7 ## 2.2.0 (2021-04-06)
2 8  
3 9 ### ✨ Features
... ...
build/vite/plugin/theme.ts
... ... @@ -3,6 +3,7 @@
3 3 * https://github.com/anncwb/vite-plugin-theme
4 4 */
5 5 import type { Plugin } from 'vite';
  6 +import path from 'path';
6 7 import {
7 8 viteThemePlugin,
8 9 antdDarkThemePlugin,
... ... @@ -25,6 +26,10 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
25 26 colorVariables: [...getThemeColors(), ...colors],
26 27 }),
27 28 antdDarkThemePlugin({
  29 + preloadFiles: [
  30 + path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'),
  31 + path.resolve(process.cwd(), 'src/design/index.less'),
  32 + ],
28 33 filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
29 34 // extractCss: false,
30 35 darkModifyVars: {
... ...
package.json
... ... @@ -114,7 +114,7 @@
114 114 "vite-plugin-pwa": "^0.7.0",
115 115 "vite-plugin-style-import": "^0.9.2",
116 116 "vite-plugin-svg-icons": "^0.4.1",
117   - "vite-plugin-theme": "^0.6.1",
  117 + "vite-plugin-theme": "^0.6.3",
118 118 "vite-plugin-windicss": "0.12.5",
119 119 "vue-eslint-parser": "^7.6.0"
120 120 },
... ...
src/components/Form/src/components/FormItem.vue
... ... @@ -210,7 +210,7 @@
210 210 props.setFormModel(field, value);
211 211 },
212 212 };
213   - const Comp = componentMap.get(component) as typeof defineComponent;
  213 + const Comp = componentMap.get(component) as ReturnType<typeof defineComponent>;
214 214  
215 215 const { autoSetPlaceHolder, size } = props.formProps;
216 216 const propsData: Recordable = {
... ...
src/views/sys/login/Login.vue
... ... @@ -30,6 +30,7 @@
30 30 </div>
31 31 <div class="h-full xl:h-auto flex py-5 xl:py-0 xl:my-0 w-full xl:w-6/12">
32 32 <div
  33 + :class="`${prefixCls}-form`"
33 34 class="my-auto mx-auto xl:ml-20 xl:bg-transparent px-5 py-8 sm:px-8 xl:p-4 rounded-md shadow-md xl:shadow-none w-full sm:w-3/4 lg:w-2/4 xl:w-auto enter-x relative"
34 35 >
35 36 <LoginForm />
... ... @@ -89,10 +90,11 @@
89 90 @prefix-cls: ~'@{namespace}-login';
90 91 @logo-prefix-cls: ~'@{namespace}-app-logo';
91 92 @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  93 + @dark-bg: #293146;
92 94  
93 95 html[data-theme='dark'] {
94 96 .@{prefix-cls} {
95   - background: #293146;
  97 + background: @dark-bg;
96 98  
97 99 &::before {
98 100 background-image: url(/@/assets/svg/login-bg-dark.svg);
... ... @@ -106,13 +108,21 @@
106 108 .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
107 109 border: 1px solid #4a5569;
108 110 }
  111 +
  112 + &-form {
  113 + background: transparent !important;
  114 + }
109 115 }
110 116 }
111 117  
112 118 .@{prefix-cls} {
113 119 overflow: hidden;
114 120 @media (max-width: @screen-xl) {
115   - background: linear-gradient(180deg, #1c3faa, #1c3faa);
  121 + background: #293146;
  122 +
  123 + .@{prefix-cls}-form {
  124 + background: #fff;
  125 + }
116 126 }
117 127  
118 128 &::before {
... ...
src/views/sys/login/LoginForm.vue
... ... @@ -46,7 +46,7 @@
46 46 {{ t('sys.login.mobileSignInFormTitle') }}
47 47 </Button>
48 48 </ACol>
49   - <ACol :md="8" :xs="24" class="xs:my-2 md:my-0 xs:mx-0 md:mx-2">
  49 + <ACol :md="8" :xs="24" class="!my-2 !md:my-0 xs:mx-0 md:mx-2">
50 50 <Button block @click="setLoginState(LoginStateEnum.QR_CODE)">
51 51 {{ t('sys.login.qrSignInFormTitle') }}
52 52 </Button>
... ...
yarn.lock
... ... @@ -9173,10 +9173,10 @@ vite-plugin-svg-icons@^0.4.1:
9173 9173 svg-baker "1.7.0"
9174 9174 svgo "^2.3.0"
9175 9175  
9176   -vite-plugin-theme@^0.6.1:
9177   - version "0.6.1"
9178   - resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.1.tgz#8fd87e1d57ae83f49531aeb65bfc8f6adcf2b71f"
9179   - integrity sha512-r+v+AxeatliReg6fBkCbKQ/PHpv0J9EG22QLoAyXNPdZxei+xydxdHVWrN2nUh231im0v9fZzWKzOOxw5VW0fA==
  9176 +vite-plugin-theme@^0.6.3:
  9177 + version "0.6.3"
  9178 + resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.3.tgz#77be00b039eb53452c9adfce7fd90e39a39a81ee"
  9179 + integrity sha512-ffhnqCtCG/0Y7egfiF9upJRo5ZEKS6lQOQsSztqu8gA2/SGsNTm3lsmEWvARMeUAj/8aF5PYzAv5EikfhcPENQ==
9180 9180 dependencies:
9181 9181 "@types/node" "^14.14.37"
9182 9182 "@types/tinycolor2" "^1.4.2"
... ...