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 ## 2.2.0 (2021-04-06) 7 ## 2.2.0 (2021-04-06)
2 8
3 ### ✨ Features 9 ### ✨ Features
build/vite/plugin/theme.ts
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 * https://github.com/anncwb/vite-plugin-theme 3 * https://github.com/anncwb/vite-plugin-theme
4 */ 4 */
5 import type { Plugin } from 'vite'; 5 import type { Plugin } from 'vite';
  6 +import path from 'path';
6 import { 7 import {
7 viteThemePlugin, 8 viteThemePlugin,
8 antdDarkThemePlugin, 9 antdDarkThemePlugin,
@@ -25,6 +26,10 @@ export function configThemePlugin(isBuild: boolean): Plugin[] { @@ -25,6 +26,10 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
25 colorVariables: [...getThemeColors(), ...colors], 26 colorVariables: [...getThemeColors(), ...colors],
26 }), 27 }),
27 antdDarkThemePlugin({ 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 filter: (id) => (isBuild ? !id.endsWith('antd.less') : true), 33 filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
29 // extractCss: false, 34 // extractCss: false,
30 darkModifyVars: { 35 darkModifyVars: {
package.json
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 "vite-plugin-pwa": "^0.7.0", 114 "vite-plugin-pwa": "^0.7.0",
115 "vite-plugin-style-import": "^0.9.2", 115 "vite-plugin-style-import": "^0.9.2",
116 "vite-plugin-svg-icons": "^0.4.1", 116 "vite-plugin-svg-icons": "^0.4.1",
117 - "vite-plugin-theme": "^0.6.1", 117 + "vite-plugin-theme": "^0.6.3",
118 "vite-plugin-windicss": "0.12.5", 118 "vite-plugin-windicss": "0.12.5",
119 "vue-eslint-parser": "^7.6.0" 119 "vue-eslint-parser": "^7.6.0"
120 }, 120 },
src/components/Form/src/components/FormItem.vue
@@ -210,7 +210,7 @@ @@ -210,7 +210,7 @@
210 props.setFormModel(field, value); 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 const { autoSetPlaceHolder, size } = props.formProps; 215 const { autoSetPlaceHolder, size } = props.formProps;
216 const propsData: Recordable = { 216 const propsData: Recordable = {
src/views/sys/login/Login.vue
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 </div> 30 </div>
31 <div class="h-full xl:h-auto flex py-5 xl:py-0 xl:my-0 w-full xl:w-6/12"> 31 <div class="h-full xl:h-auto flex py-5 xl:py-0 xl:my-0 w-full xl:w-6/12">
32 <div 32 <div
  33 + :class="`${prefixCls}-form`"
33 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 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 <LoginForm /> 36 <LoginForm />
@@ -89,10 +90,11 @@ @@ -89,10 +90,11 @@
89 @prefix-cls: ~'@{namespace}-login'; 90 @prefix-cls: ~'@{namespace}-login';
90 @logo-prefix-cls: ~'@{namespace}-app-logo'; 91 @logo-prefix-cls: ~'@{namespace}-app-logo';
91 @countdown-prefix-cls: ~'@{namespace}-countdown-input'; 92 @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  93 + @dark-bg: #293146;
92 94
93 html[data-theme='dark'] { 95 html[data-theme='dark'] {
94 .@{prefix-cls} { 96 .@{prefix-cls} {
95 - background: #293146; 97 + background: @dark-bg;
96 98
97 &::before { 99 &::before {
98 background-image: url(/@/assets/svg/login-bg-dark.svg); 100 background-image: url(/@/assets/svg/login-bg-dark.svg);
@@ -106,13 +108,21 @@ @@ -106,13 +108,21 @@
106 .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) { 108 .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
107 border: 1px solid #4a5569; 109 border: 1px solid #4a5569;
108 } 110 }
  111 +
  112 + &-form {
  113 + background: transparent !important;
  114 + }
109 } 115 }
110 } 116 }
111 117
112 .@{prefix-cls} { 118 .@{prefix-cls} {
113 overflow: hidden; 119 overflow: hidden;
114 @media (max-width: @screen-xl) { 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 &::before { 128 &::before {
src/views/sys/login/LoginForm.vue
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 {{ t('sys.login.mobileSignInFormTitle') }} 46 {{ t('sys.login.mobileSignInFormTitle') }}
47 </Button> 47 </Button>
48 </ACol> 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 <Button block @click="setLoginState(LoginStateEnum.QR_CODE)"> 50 <Button block @click="setLoginState(LoginStateEnum.QR_CODE)">
51 {{ t('sys.login.qrSignInFormTitle') }} 51 {{ t('sys.login.qrSignInFormTitle') }}
52 </Button> 52 </Button>
yarn.lock
@@ -9173,10 +9173,10 @@ vite-plugin-svg-icons@^0.4.1: @@ -9173,10 +9173,10 @@ vite-plugin-svg-icons@^0.4.1:
9173 svg-baker "1.7.0" 9173 svg-baker "1.7.0"
9174 svgo "^2.3.0" 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 dependencies: 9180 dependencies:
9181 "@types/node" "^14.14.37" 9181 "@types/node" "^14.14.37"
9182 "@types/tinycolor2" "^1.4.2" 9182 "@types/tinycolor2" "^1.4.2"