Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add None Popup Shadow Option #1423

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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';
Copy link
Member Author

Choose a reason for hiding this comment

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

Was this just missed? It seemed to be missing so I just added it for completeness.

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
Loading