Skip to content

Commit

Permalink
fix: improve login page style
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Apr 8, 2021
1 parent 96a49ba commit 780a8a6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Wip

### 🐛 Bug Fixes

- 登录页样式修复

## 2.2.0 (2021-04-06)

### ✨ Features
Expand Down
5 changes: 5 additions & 0 deletions build/vite/plugin/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* https://github.com/anncwb/vite-plugin-theme
*/
import type { Plugin } from 'vite';
import path from 'path';
import {
viteThemePlugin,
antdDarkThemePlugin,
Expand All @@ -25,6 +26,10 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
colorVariables: [...getThemeColors(), ...colors],
}),
antdDarkThemePlugin({
preloadFiles: [
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'),
path.resolve(process.cwd(), 'src/design/index.less'),
],
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
// extractCss: false,
darkModifyVars: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"vite-plugin-pwa": "^0.7.0",
"vite-plugin-style-import": "^0.9.2",
"vite-plugin-svg-icons": "^0.4.1",
"vite-plugin-theme": "^0.6.1",
"vite-plugin-theme": "^0.6.3",
"vite-plugin-windicss": "0.12.5",
"vue-eslint-parser": "^7.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
props.setFormModel(field, value);
},
};
const Comp = componentMap.get(component) as typeof defineComponent;
const Comp = componentMap.get(component) as ReturnType<typeof defineComponent>;
const { autoSetPlaceHolder, size } = props.formProps;
const propsData: Recordable = {
Expand Down
14 changes: 12 additions & 2 deletions src/views/sys/login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
</div>
<div class="h-full xl:h-auto flex py-5 xl:py-0 xl:my-0 w-full xl:w-6/12">
<div
:class="`${prefixCls}-form`"
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"
>
<LoginForm />
Expand Down Expand Up @@ -89,10 +90,11 @@
@prefix-cls: ~'@{namespace}-login';
@logo-prefix-cls: ~'@{namespace}-app-logo';
@countdown-prefix-cls: ~'@{namespace}-countdown-input';
@dark-bg: #293146;
html[data-theme='dark'] {
.@{prefix-cls} {
background: #293146;
background: @dark-bg;
&::before {
background-image: url(/@/assets/svg/login-bg-dark.svg);
Expand All @@ -106,13 +108,21 @@
.ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
border: 1px solid #4a5569;
}
&-form {
background: transparent !important;
}
}
}
.@{prefix-cls} {
overflow: hidden;
@media (max-width: @screen-xl) {
background: linear-gradient(180deg, #1c3faa, #1c3faa);
background: #293146;
.@{prefix-cls}-form {
background: #fff;
}
}
&::before {
Expand Down
2 changes: 1 addition & 1 deletion src/views/sys/login/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{{ t('sys.login.mobileSignInFormTitle') }}
</Button>
</ACol>
<ACol :md="8" :xs="24" class="xs:my-2 md:my-0 xs:mx-0 md:mx-2">
<ACol :md="8" :xs="24" class="!my-2 !md:my-0 xs:mx-0 md:mx-2">
<Button block @click="setLoginState(LoginStateEnum.QR_CODE)">
{{ t('sys.login.qrSignInFormTitle') }}
</Button>
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9173,10 +9173,10 @@ vite-plugin-svg-icons@^0.4.1:
svg-baker "1.7.0"
svgo "^2.3.0"

vite-plugin-theme@^0.6.1:
version "0.6.1"
resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.1.tgz#8fd87e1d57ae83f49531aeb65bfc8f6adcf2b71f"
integrity sha512-r+v+AxeatliReg6fBkCbKQ/PHpv0J9EG22QLoAyXNPdZxei+xydxdHVWrN2nUh231im0v9fZzWKzOOxw5VW0fA==
vite-plugin-theme@^0.6.3:
version "0.6.3"
resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.3.tgz#77be00b039eb53452c9adfce7fd90e39a39a81ee"
integrity sha512-ffhnqCtCG/0Y7egfiF9upJRo5ZEKS6lQOQsSztqu8gA2/SGsNTm3lsmEWvARMeUAj/8aF5PYzAv5EikfhcPENQ==
dependencies:
"@types/node" "^14.14.37"
"@types/tinycolor2" "^1.4.2"
Expand Down

0 comments on commit 780a8a6

Please sign in to comment.