diff --git a/index.less b/index.less index 624c9ed..8579bf8 100644 --- a/index.less +++ b/index.less @@ -46,9 +46,3 @@ @import "styles/languages/shell"; @import "styles/languages/yaml"; @import "styles/languages/xml"; - -/*+----------------+ - + Theme Settings + - +----------------+*/ -@import "styles/syntax-theme-settings"; -@import "styles/theme-settings-store"; diff --git a/lib/constants.js b/lib/constants.js deleted file mode 100644 index 0921e72..0000000 --- a/lib/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -"use babel"; -"use strict"; - -/* - * Copyright (c) 2016-present Arctic Ice Studio - * Copyright (c) 2016-present Sven Greb - * - * Project: Nord Atom Syntax - * Repository: https://github.com/arcticicestudio/nord-atom-syntax - * License: MIT - */ - -module.exports = Object.freeze({ - DEFAULT_COMMENT_CONTRAST: 0, - MINIMUM_COMMENT_CONTRAST: 0, - MAXIMUM_COMMENT_CONTRAST: 20 -}); diff --git a/lib/main.js b/lib/main.js index 31f9ec2..98f56dc 100644 --- a/lib/main.js +++ b/lib/main.js @@ -10,15 +10,18 @@ * License: MIT */ -import fs from "fs"; -import { toggleClass } from "./utils"; - export default { - writeConfig(options) { + handleDeprecatedCustomCommentContrastSetting(options) { let customCommentContrast = atom.config.get("nord-atom-syntax.accessibility.commentContrast"); - let config = `@theme-setting-accessibility-custom-comment-contrast: ${customCommentContrast}%;\n`; + if (customCommentContrast != 0) { + atom.notifications.addWarning(`The "Custom Comment Contrast" theme setting is deprecated and will be removed in version 1.0.0!`, { + detail: "To adapt to the change reset the setting to the default value by deleting the user-defined value from the text field or setting the value to 0.", + description: `The comment color brightness has been increased by 10% by default! + As of version 0.4.0, the setting has no effect anymore. Please see [arcticicestudio/nord-atom-syntax#60](https://github.com/arcticicestudio/nord-atom-syntax/issues/60) for more details.`, + dismissable: true, + icon: "megaphone" + }); - fs.writeFile(`${__dirname}/../styles/theme-settings-store.less`, config, "utf8", () => { if (!options || !options.noReload) { let themePack = atom.packages.getLoadedPackage("nord-atom-syntax"); @@ -28,12 +31,11 @@ export default { } if (options && options.callback && typeof options.callback === "function") { options.callback(); - } - }); + }; + } }, activate() { - toggleClass(true, "theme-nord-atom-syntax-accessibility-custom-comment-contrast"); - atom.config.onDidChange("nord-atom-syntax.accessibility.commentContrast", () =>this.writeConfig({ noReload: true })); + atom.config.onDidChange("nord-atom-syntax.accessibility.commentContrast", () => this.handleDeprecatedCustomCommentContrastSetting({ noReload: true })); } }; diff --git a/lib/utils.js b/lib/utils.js deleted file mode 100644 index a9ba20f..0000000 --- a/lib/utils.js +++ /dev/null @@ -1,23 +0,0 @@ -"use babel"; -"use strict"; - -/* - * Copyright (c) 2016-present Arctic Ice Studio - * Copyright (c) 2016-present Sven Greb - * - * Project: Nord Atom Syntax - * Repository: https://github.com/arcticicestudio/nord-atom-syntax - * License: MIT - */ - -export default { - toggleClass(boolean, className) { - let root = document.querySelector("atom-workspace"); - - if (boolean) { - root.classList.add(className); - } else { - root.classList.remove(className); - } - } -}; diff --git a/styles/colors.less b/styles/colors.less new file mode 100644 index 0000000..d8054d3 --- /dev/null +++ b/styles/colors.less @@ -0,0 +1,10 @@ +/* + * Copyright (C) 2016-present Arctic Ice Studio + * Copyright (C) 2016-present Sven Greb + * + * Project: Nord Atom Syntax + * Repository: https://github.com/arcticicestudio/nord-atom-syntax + * License: MIT + */ + +@nord3-brightened: #616E88; diff --git a/styles/syntax-theme-settings.less b/styles/syntax-theme-settings.less deleted file mode 100644 index cac265a..0000000 --- a/styles/syntax-theme-settings.less +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016-present Arctic Ice Studio - * Copyright (c) 2016-present Sven Greb - * - * Project: Nord Atom Syntax - * Repository: https://github.com/arcticicestudio/nord-atom-syntax - * License: MIT - */ - -/*+---------------+ - + Accessibility + - +---------------+*/ -/*+--- Custom Comment Contrast ---+*/ -.theme-@{syntax-theme-name}-accessibility-custom-comment-contrast { - .syntax--comment { - color: lighten(@syntax-color-comment, @theme-setting-accessibility-custom-comment-contrast); - - .syntax--markup.syntax--link { - color: lighten(@syntax-color-comment, @theme-setting-accessibility-custom-comment-contrast); - } - } - - .syntax--punctuation { - &.syntax--comment { - color: lighten(@syntax-color-comment, @theme-setting-accessibility-custom-comment-contrast); - } - } -} diff --git a/styles/syntax-variables.less b/styles/syntax-variables.less index bcb2fd6..18ffcfe 100644 --- a/styles/syntax-variables.less +++ b/styles/syntax-variables.less @@ -11,6 +11,7 @@ + Imports + +---------+*/ @import "nord"; +@import "colors"; /*+------------+ + Animations + @@ -62,7 +63,7 @@ @syntax-color-attribute: @nord7; @syntax-color-attribute-id: @nord7; @syntax-color-class: @nord7; -@syntax-color-comment: @nord3; +@syntax-color-comment: @nord3-brightened; @syntax-color-constant: @nord7; @syntax-color-embedded: @nord9; @syntax-color-escape: @nord12; diff --git a/styles/theme-settings-store.less b/styles/theme-settings-store.less deleted file mode 100644 index 44840f4..0000000 --- a/styles/theme-settings-store.less +++ /dev/null @@ -1 +0,0 @@ -@theme-setting-accessibility-custom-comment-contrast: 8%;