Add Fluent theme support
This commit is contained in:
@@ -37,6 +37,7 @@ These themes have been tested and work out of the box without any configuration.
|
||||
- Cabinet
|
||||
- ChromeOS
|
||||
- Flat-Remix-GTK
|
||||
- Fluent
|
||||
- HighContrast
|
||||
- Kimi
|
||||
- Layan
|
||||
@@ -70,6 +71,7 @@ These themes have been tested and work out of the box without any configuration.
|
||||
- Canta
|
||||
- ChromeOS
|
||||
- Flat-Remix
|
||||
- Fluent
|
||||
- Kimi
|
||||
- Layan
|
||||
- Matcha (Manjaro default)
|
||||
|
||||
@@ -44,7 +44,7 @@ var GtkVariants = class {
|
||||
} else if (name.match('Cabinet')) {
|
||||
variants.set(Time.DAY, name.replace(/-Dark(?!er)/, '-Light'));
|
||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-Light|-Darker)/, '-Dark'));
|
||||
} else if (name.match(/^(Canta|ChromeOS|Materia|Orchis).*-compact/)) {
|
||||
} else if (name.match(/^(Canta|ChromeOS|Fluent|Materia|Orchis).*-compact/)) {
|
||||
variants.set(Time.DAY, name.replace('-dark', ''));
|
||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-light)?-compact/, '-dark-compact'));
|
||||
} else if (name.includes('Flat-Remix-GTK')) {
|
||||
|
||||
@@ -44,7 +44,7 @@ var ShellVariants = class {
|
||||
} else if (name.includes('Arc')) {
|
||||
variants.set(Time.DAY, name.replace('-Dark', ''));
|
||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace('Arc', 'Arc-Dark'));
|
||||
} else if (name.match(/^(Canta|ChromeOS|Materia|Orchis).*-compact/)) {
|
||||
} else if (name.match(/^(Canta|ChromeOS|Fluent|Materia|Orchis).*-compact/)) {
|
||||
variants.set(Time.DAY, name.replace('-dark', ''));
|
||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-light)?-compact/, '-dark-compact'));
|
||||
} else if (name.includes('Flat-Remix')) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const test = require('ava');
|
||||
const { Time, Variants } = require('./_variants');
|
||||
|
||||
|
||||
['', '-green', '-grey', '-orange', '-pink', '-purple', '-red', '-teal', '-yellow'].forEach(color => {
|
||||
['', '-compact'].forEach(size => {
|
||||
test(`Fluent${color}${size}`, t => {
|
||||
const variants = Variants.guessFrom(`Fluent${color}${size}`);
|
||||
t.is(variants.get(Time.DAY), `Fluent${color}${size}`);
|
||||
t.is(variants.get(Time.NIGHT), `Fluent${color}-dark${size}`);
|
||||
});
|
||||
|
||||
test(`Fluent${color}-light${size}`, t => {
|
||||
const variants = Variants.guessFrom(`Fluent${color}-light${size}`);
|
||||
t.is(variants.get(Time.DAY), `Fluent${color}-light${size}`);
|
||||
t.is(variants.get(Time.NIGHT), `Fluent${color}-dark${size}`);
|
||||
});
|
||||
test(`Fluent${color}-dark${size}`, t => {
|
||||
const variants = Variants.guessFrom(`Fluent${color}-dark${size}`);
|
||||
t.is(variants.get(Time.DAY), `Fluent${color}${size}`);
|
||||
t.is(variants.get(Time.NIGHT), `Fluent${color}-dark${size}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const test = require('ava');
|
||||
const { Time, Variants } = require('./_variants');
|
||||
|
||||
|
||||
['', '-green', '-grey', '-orange', '-pink', '-purple', '-red', '-teal', '-yellow'].forEach(color => {
|
||||
['', '-compact'].forEach(size => {
|
||||
test(`Fluent${color}${size}`, t => {
|
||||
const variants = Variants.guessFrom(`Fluent${color}${size}`);
|
||||
t.is(variants.get(Time.DAY), `Fluent${color}${size}`);
|
||||
t.is(variants.get(Time.NIGHT), `Fluent${color}-dark${size}`);
|
||||
});
|
||||
|
||||
test(`Fluent${color}-light${size}`, t => {
|
||||
const variants = Variants.guessFrom(`Fluent${color}-light${size}`);
|
||||
t.is(variants.get(Time.DAY), `Fluent${color}-light${size}`);
|
||||
t.is(variants.get(Time.NIGHT), `Fluent${color}-dark${size}`);
|
||||
});
|
||||
test(`Fluent${color}-dark${size}`, t => {
|
||||
const variants = Variants.guessFrom(`Fluent${color}-dark${size}`);
|
||||
t.is(variants.get(Time.DAY), `Fluent${color}${size}`);
|
||||
t.is(variants.get(Time.NIGHT), `Fluent${color}-dark${size}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user