Skip to content

Commit

Permalink
Add None Popup Shadow Option (#1423)
Browse files Browse the repository at this point in the history
Add `None` Outer Theme Option
  • Loading branch information
MarvNC authored Sep 17, 2024
1 parent 547a628 commit 5bc916c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ext/css/popup-outer.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ iframe.yomitan-popup[data-theme=dark] {
iframe.yomitan-popup[data-outer-theme=dark] {
box-shadow: 0 0 10em rgba(255, 255, 255, 0.5);
}
iframe.yomitan-popup[data-outer-theme=none] {
box-shadow: none;
}
iframe.yomitan-popup[data-popup-display-mode=full-width] {
border-left: none;
border-right: none;
Expand Down
2 changes: 1 addition & 1 deletion ext/data/schemas/options-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
},
"popupOuterTheme": {
"type": "string",
"enum": ["light", "dark", "browser", "site"],
"enum": ["light", "dark", "browser", "site", "none"],
"default": "site"
},
"customPopupCss": {
Expand Down
12 changes: 6 additions & 6 deletions ext/js/app/theme-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export class ThemeController {
constructor(element) {
/** @type {?HTMLElement} */
this._element = element;
/** @type {'light'|'dark'|'browser'|'site'} */
/** @type {import("settings.js").PopupTheme} */
this._theme = 'site';
/** @type {'light'|'dark'|'browser'|'site'} */
/** @type {import("settings.js").PopupOuterTheme} */
this._outerTheme = 'site';
/** @type {?('dark'|'light')} */
this._siteTheme = null;
Expand Down Expand Up @@ -57,31 +57,31 @@ export class ThemeController {

/**
* Gets the main theme for the content.
* @type {'light'|'dark'|'browser'|'site'}
* @type {import("settings.js").PopupTheme}
*/
get theme() {
return this._theme;
}

/**
* Sets the main theme for the content.
* @param {'light'|'dark'|'browser'|'site'} value The theme value to assign.
* @param {import("settings.js").PopupTheme} value The theme value to assign.
*/
set theme(value) {
this._theme = value;
}

/**
* Gets the outer theme for the content.
* @type {'light'|'dark'|'browser'|'site'}
* @type {import("settings.js").PopupOuterTheme}
*/
get outerTheme() {
return this._outerTheme;
}

/**
* Sets the outer theme for the content.
* @param {'light'|'dark'|'browser'|'site'} value The outer theme value to assign.
* @param {import("settings.js").PopupOuterTheme} value The outer theme value to assign.
*/
set outerTheme(value) {
this._outerTheme = value;
Expand Down
1 change: 1 addition & 0 deletions ext/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ <h1>Yomitan Settings</h1>
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="browser">Browser</option>
<option value="none">None</option>
</select>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions types/ext/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ export type PopupVerticalTextPosition = 'default' | 'before' | 'after' | 'left'

export type GlossaryLayoutMode = 'default' | 'compact';

export type PopupTheme = 'light' | 'dark' | 'browser';
export type PopupTheme = 'light' | 'dark' | 'browser' | 'site';

export type PopupOuterTheme = 'light' | 'dark' | 'browser' | 'site';
export type PopupOuterTheme = 'light' | 'dark' | 'browser' | 'site' | 'none';

export type PopupCurrentIndicatorMode = 'none' | 'asterisk' | 'triangle' | 'bar-left' | 'bar-right' | 'dot-left' | 'dot-right';

Expand Down

0 comments on commit 5bc916c

Please sign in to comment.