Skip to content

Commit

Permalink
Merge pull request Tencent#307 from progrape/feature/dark
Browse files Browse the repository at this point in the history
feat: 支持黑色主题
  • Loading branch information
Maizify authored Mar 5, 2020
2 parents 8618c4f + 581302d commit 5ccbcaa
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 59 deletions.
1 change: 1 addition & 0 deletions dist/vconsole.min.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare module 'vconsole' {
onClearLog?: () => void
maxLogNumber?: number
disableLogScrolling?: boolean
theme?: 'light' | 'dark'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/vconsole.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ class VConsole {

// remove from less to present transition effect
$.one('.vc-mask', this.$dom).style.display = 'none';

// set theme
if (this.option.theme) {
this.$dom.setAttribute('data-theme', this.option.theme);
}
};

/**
Expand Down
Loading

0 comments on commit 5ccbcaa

Please sign in to comment.