Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion public/theme/element-ui.css

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/components/Common/DataActions/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@ $color-drop-menu-border: #e4e7ed;
::v-deep .action-item.el-dropdown .el-button {
display: block;
color: var(--color-primary);
background-color: $color-btn-background;
border-color: $color-btn-focus-background;

&:focus {
color: $btn-text-color;
Expand Down
26 changes: 19 additions & 7 deletions src/layout/components/NavHeader/ViewSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ export default {

<style lang="scss" scoped>
.menu-main.el-menu {
background-color: transparent;
letter-spacing: 0.09em;
background-color: #1e2733 !important;
border-radius: 8px;
padding: 6px;
min-width: 180px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
letter-spacing: 0.05em;

::v-deep .el-submenu .el-submenu__title {
height: 38px;
Expand All @@ -143,17 +147,24 @@ export default {

& ::v-deep .el-icon-arrow-down {
font-size: 13px;
color: #606266;
color: var(--menu-text);
}

.el-menu-item {
height: 38px;
width: 160px;
line-height: 28px;
padding: 4px 24px;
padding: 6px 14px;
color: var(--menu-text);
border-radius: 6px;

&:hover {
background-color: var(--menu-hover);
color: var(--menu-text-active);
background: var(--menu-hover);
}

&.is-active {
color: #e5edf7;
background: linear-gradient(90deg, rgba(64, 158, 255, 0.28) 0%, #22344b 30%, #1e2733 100%);
}
}
}
Expand Down Expand Up @@ -196,13 +207,14 @@ export default {
vertical-align: middle !important;
font-size: 14px;
text-align: center;
color: #1F2329;
color: var(--menu-text);
margin-right: 10px;
}

.icons-title {
display: inline-block;
font-size: 13px;
color: inherit;

.menu-main.mobile-view-switch ::v-deep .el-submenu__icon-arrow {
right: 10px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize, but I can't review or analyze code without a specific file or context. Please share the files or codes from where you want me to check for potential issues, irregularities, optimizing suggestions, etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an actual code to check with. Please provide the desired changes you want me to review and I'll do my best to help.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but I can't review or analyze the provided code snippet as it is missing. Please provide more information about which code you want me to compare and discuss.

Expand Down
6 changes: 3 additions & 3 deletions src/layout/components/NavHeader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default {

& ::v-deep .svg-icon {
line-height: 40px;
color: #fff;
color: #eef3fb;
font-size: 15px;
}

Expand All @@ -242,7 +242,7 @@ export default {
}

& ::v-deep i {
color: #fff;
color: #eef3fb;
font-size: 16px;

&.el-icon-arrow-down {
Expand All @@ -262,7 +262,7 @@ export default {
}

&:hover {
background: rgba(0, 0, 0, 12%);
background: rgba(255, 255, 255, 0.08);
}
}
}
Expand Down
44 changes: 37 additions & 7 deletions src/layout/components/NavLeft/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
</div>
<div class="nav-title">
<span :class="switchViewOtherClasses" class="switch-view active-switch-view">
<el-popover :open-delay="200" placement="right-start" trigger="hover">
<el-popover
:open-delay="200"
placement="right-start"
popper-class="switcher-popper"
trigger="hover"
>
<span slot="reference" style="width: 100%">
<el-tooltip
v-show="!isCollapse"
Expand Down Expand Up @@ -168,9 +173,9 @@ export default {

$mobileHeight: 40px;
$origin-color: #ffffff;
$hover-bg-color: #e6e6e6;
$hover-text-color: #606266;
$hover-border-color: #d2d2d2;
$hover-bg-color: var(--menu-hover);
$hover-text-color: var(--menu-text-active);
$hover-border-color: transparent;

.left-side-wrapper {
.nav-header {
Expand Down Expand Up @@ -227,9 +232,9 @@ $hover-border-color: #d2d2d2;
white-space: nowrap;
cursor: pointer;
transition: all 0.3s;
color: var(--color-text-primary);
color: var(--menu-text);
background-color: var(--menu-bg);
border-bottom: 1px solid var(--color-border);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);

.switch-view {
width: 100%;
Expand Down Expand Up @@ -273,8 +278,9 @@ $hover-border-color: #d2d2d2;
.nav-footer {
display: flex;
justify-content: flex-start;
border-top: 1px solid rgba(31, 35, 41, 0.15);
border-top: 1px solid rgba(255, 255, 255, 0.06);
background-color: $subMenuBg;
color: var(--menu-text);

.toggle-bar {
display: flex;
Expand Down Expand Up @@ -333,6 +339,30 @@ $hover-border-color: #d2d2d2;
}
}
}

// view switcher popover
::v-deep .switcher-popper {
padding: 8px 6px;
background: #1e2733;
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
.el-menu {
background: transparent;
}
.el-menu-item {
color: var(--menu-text);
border-radius: 6px;
margin-bottom: 4px;
&:hover {
color: var(--menu-text-active);
background: var(--menu-hover);
}
&.is-active {
color: #e5edf7;
background: linear-gradient(90deg, rgba(64, 158, 255, 0.28) 0%, #22344b 30%, #1e2733 100%);
}
}
}
}

@media screen and (max-width: 992px) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the provided code snippet, there appear to be some minor inconsistencies between CSS property names used in inline styles ('$mobileWidth', '$borderRadius') and actual JavaScript variable names with underscores like 'MobileWidth', '_borderRadius'. However, given that these properties are likely aliases for their corresponding variables, they may not present any issues when viewed alone.

For an optimized/checked version of this code, one could add a common utility rule (common-style below), instead of having multiple inline rules with various selectors. It can then remove unnecessary comments and ensure consistent style management across different parts of your application using the @import feature:

.common-style {
  /* ... */
}

/**
 * Utility rule to apply default styling here if needed
 *
 * This should be added after `@import` declarations, so it's considered outside any element
 * context. Use at least once per file or library import where applicable.
 */

// Example of applying the "common style" to all body elements within a component container:
*{
  // Your custom CSS classes/specific style here
}

This approach provides better organization by avoiding duplication and potentially simplifying conditional queries throughout your project's stylesheet.
Note: The above explanation assumes you're working within Vue.js framework. If you need recommendations tailored towards ReactJS environment, such adjustments might vary slightly based on specific syntax conventions employed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I have to let you know that there doesn't appear to be any content or code provided for me to review. Could you please check and rephrase your request so it's more concrete?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but I can't see any discrepancies between the two versions of the JavaScript code you provided because they don't seem to be related or match within a meaningful context.

However, if you need help with specific bugs, inefficiencies, optimizations, etc., please provide more details about what needs improvement in the version that's causing an issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided HTML code does not contain any specific code diffs, potential issues, or optimizations that need to be checked.

However, if you have specific questions about certain elements of the code, such as how it is being structured in terms of CSS classes vs native Bootstrap components, please provide more details so I can accurately answer them.

Expand Down
16 changes: 8 additions & 8 deletions src/styles/default-theme.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
:export {
--color-primary: #1ab394;
--color-primary: #409EFF;
--color-success: #2793d7;
--color-info: #1c84c6;
--color-warning: #f8ac59;
--color-danger: #ed5565;
--color-link: #1c84c6;
--color-link: #409EFF;
--color-text-primary: #292827;
--color-text-secondary: #7c7c7c;
--color-icon-primary: #605e5c;
Expand All @@ -13,10 +13,10 @@
--color-disabled-background: #F5F7FA;
--color-disabled: #bbb;
--color-help-text: #8F959E;
--banner-bg: #148f76;
--submenu-bg: #ffffff;
--menu-bg: #ffffff;
--menu-text: #646A73;
--menu-text-active: #1ab394;
--menu-hover: #ffffff;
--banner-bg: #1e2733;
--submenu-bg: #1e2733;
--menu-bg: #1e2733;
--menu-text: #cdd5e3;
--menu-text-active: #36a8ff;
--menu-hover: #1f3047;
}
6 changes: 3 additions & 3 deletions src/styles/element-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $--color-transition-base: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) !defau
/* Color
-------------------------- */
/// color|1|Brand Color|0
$--color-primary: #1ab394 !default;
$--color-primary: #409eff !default;
/// color|1|Background Color|4
$--color-white: #ffffff !default;
/// color|1|Background Color|4
Expand Down Expand Up @@ -73,8 +73,8 @@ $--background-color-base: #f5f7fa !default;

/* Link
-------------------------- */
$--link-color: $--color-success !default;
$--link-hover-color: $--color-success-lighter !default;
$--link-color: $--color-primary !default;
$--link-hover-color: $--color-primary-light-2 !default;

/* Border
-------------------------- */
Expand Down
82 changes: 72 additions & 10 deletions src/styles/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,68 @@ $single-menu-height: 38px;
}
}

.switcher-popper {
padding: 6px !important;
background: var(--menu-bg) !important;
border: 1px solid rgba(255, 255, 255, 0.08) !important;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
&.el-popper[x-placement^='right'] .popper__arrow,
&.el-popper[x-placement^='left'] .popper__arrow,
&.el-popper[x-placement^='top'] .popper__arrow,
&.el-popper[x-placement^='bottom'] .popper__arrow {
border-color: transparent;
border-right-color: rgba(255, 255, 255, 0.08);
}
&.el-popper[x-placement^='right'] .popper__arrow:after,
&.el-popper[x-placement^='left'] .popper__arrow:after,
&.el-popper[x-placement^='top'] .popper__arrow:after,
&.el-popper[x-placement^='bottom'] .popper__arrow:after {
border-color: transparent;
border-right-color: var(--menu-bg);
}

.el-menu {
background: transparent !important;
padding: 0;
}

.el-menu-item {
color: var(--menu-text);
border-radius: 6px;

&:hover {
color: var(--menu-text-active);
background: var(--menu-hover);
}

&.is-active {
color: #e5edf7;
background: linear-gradient(90deg, rgba(64, 158, 255, 0.28) 0%, #22344b 30%, #1e2733 100%);
}
}

.icons,
.icons-title {
color: inherit !important;
}
}

@mixin collapse-active {
background-color: #e6e6e6;
background-color: var(--menu-hover);

&:before {
width: 0
width: 0;
}
}

.el-menu--vertical {
background-color: #fff;
background-color: var(--menu-bg);
}

.el-menu {
border-right: none !important;
background-color: inherit !important;
color: var(--menu-text);

.svg-icon, .el-icon, .fa {
width: $icon-width !important;
Expand Down Expand Up @@ -66,30 +113,42 @@ $single-menu-height: 38px;
align-items: center;
height: $single-menu-height;
line-height: $single-menu-height;
color: var(--menu-text);

&:hover {
color: var(--menu-text-active);
background: linear-gradient(90deg, rgba(54, 168, 255, 0.12) 0%, var(--menu-hover) 40%, #22344b 100%);
}
}

// 通用 item 样式
.el-menu-item {
display: flex;
align-items: center;
height: $single-menu-height;
color: var(--color-text-primary);
color: var(--menu-text);
letter-spacing: 0.02em;
font-size: 12px;
min-width: 200px;

&:hover {
color: var(--menu-text-active);
background: linear-gradient(90deg, rgba(54, 168, 255, 0.12) 0%, var(--menu-hover) 40%, #22344b 100%);
}

&.is-active {
background-color: var(--menu-hover);
color: #e5edf7;
background: linear-gradient(90deg, rgba(54, 168, 255, 0.28) 0%, #22344b 30%, #1e2733 100%);
@include only_active;

span {
color: var(--color-primary);
color: #e5edf7;
}
}
}

.group-title {
color: var(--color-text-secondary);
color: var(--menu-text);
// 分组的 title 样式
& > span {
display: block;
Expand All @@ -98,6 +157,7 @@ $single-menu-height: 38px;
font-weight: 600;
line-height: 25px;
letter-spacing: .07em;
opacity: 0.75;
}

.nest-menu {
Expand All @@ -107,12 +167,13 @@ $single-menu-height: 38px;
// 存在三级子菜单
.level1-menu {
&.el-submenu.is-opened {
border-top: solid 1px var(--color-border);
border-top: solid 1px rgba(255, 255, 255, 0.06);
}

&.el-submenu.is-active {
.el-submenu__title {
color: var(--color-primary);
color: #e5edf7;
background: linear-gradient(90deg, rgba(54, 168, 255, 0.28) 0%, #22344b 30%, #1e2733 100%);
}

.el-submenu__title, li {
Expand Down Expand Up @@ -155,7 +216,8 @@ $single-menu-height: 38px;
}

.el-divider.el-divider--horizontal {
margin: 12px 0 !important;
margin: 0 !important;
display: none;
}

.level1-menu {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide the code that you want to analyze so I can assist you with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't perform such analysis as you requested because it goes beyond my capabilities as a text-based AI assistant. My current limitations involve being able to access or analyze source files from within a chat interface.

However, I'd be thrilled if you could share the code with me! If that's not feasible due to privacy concerns on your side, please ask away - maybe someone else here would be more equipped.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style sheet provided appears to have no major issues or inconsistencies that need attention. It follows best practices related to CSS selectors, variables, and colors.

For general efficiency, consider adding comments for readability:

/* ... other styles here... */

// General utility classes 
.group-title {
  color: var(--color-text-secondary); /* group title styles */
}

.nest-menu {
  // Nested menu styles ...
};

.level1-menu {  
 // Level one sub-menu styles...
};

This provides guidance on how to add clarity into the stylesheet without changing its functionality.

Also note the potential for misinterpretation of selector usage if it's not followed consistently. For example, there is an inline comment indicating 'el-submenu.is-openedwhich seems out of place compared the surrounding context where@import url("//cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/css/all.css");` is commented out.

To be very clear you should always reference your imports in the documentation with paths leading up to them like so:

// Import external css (e.g., Font Awesome for iconset) if needed
.import "https://cdn.bootcdn.net/ajax/libs/font-awesome/6.1.3/css/fontawesome.min.css"

And then import them as necessary using @import rules.

Please update those lines of code when they are present from now till we move away entirely from browser-dependent libraries towards purely frontend development practices.

In terms of optimization, ensure all elements inside the container (.switcher-popper) have appropriate padding and use media queries accordingly for responsiveness.

Lastly, this is a static theme so there won't be any actual data loading at runtime hence performance gains over dynamic layouts aren't relevant.

However, for future updates I would recommend including tools such as PostCSS Linting or ESLint during development phases ensuring uniformity among all components across apps, reducing chances of bugs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There does not seem to be an apparent issue with the CSS styles provided here. They look well written and follow good design conventions. If there's any specific functionality you would like to optimize, please provide further context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to make adjustments based on the provided code snippet; it looks valid according to existing styles and rules.

However, here are some potential optimizations suggested from a high-level perspective (not specific to any particular lines of code):

  1. Simplify selectors like .icons which seems redundant as most elements have icons within them.
  2. Ensure consistent alignment when adding child components such as &:after.
  3. Optionally add vendor prefixes if not done already (display, align-items) using media queries with prefixes at least -webkit-.

Remember these changes should be made considering context of how they'll interact with design and behavior, rather than just for style tweaks or performance improvements without consequences.

Expand Down
2 changes: 1 addition & 1 deletion src/utils/theme/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function changeMenuColor(themeColors) {

// 后端不用返回 --menu-hover
const menuActiveTextColor = colors['--menu-text-active']
if (menuActiveTextColor) {
if (menuActiveTextColor && !colors['--menu-hover']) {
colors['--menu-hover'] = mix(white, menuActiveTextColor.replace(/#/g, ''), 90)
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,3 @@ export function replaceStyleColors(data) {

return data
}