Remove theme fallback mechanism

Remove the `fallback` property and do not fallback to using another flavour
when a pack is not available in the selected flavour.

Flavours should define all packs, and should they wish to piggy-back on
another one, they can import that other one's pack explicitly instead.
This commit is contained in:
Claire 2024-04-27 19:38:11 +02:00
parent 62bc36416f
commit 9a8be8cf49
3 changed files with 0 additions and 25 deletions

View file

@ -65,18 +65,6 @@ module ThemingConcern
return pack(data, pack_name, skin) if valid_pack_data?(data, pack_name)
return if data['name'].blank?
fallbacks = []
if data.key?('fallback')
fallbacks = data['fallback'] if data['fallback'].is_a?(Array)
fallbacks = [data['fallback']] if data['fallback'].is_a?(String)
elsif data['name'] != Setting.default_settings['flavour']
fallbacks = [Setting.default_settings['flavour']]
end
fallbacks.each do |fallback|
return resolve_pack(Themes.instance.flavour(fallback), pack_name, skin) if Themes.instance.flavour(fallback)
end
nil
end

View file

@ -46,15 +46,8 @@ screenshot: flavours/glitch/images/glitch-preview.png
# but in the case of the vanilla Mastodon flavour the pack files are
# somewhere else.
pack_directory: app/javascript/flavours/glitch/packs
# (OPTIONAL) The directory which contains the pack files.
# Defaults to the theme directory (`app/javascript/themes/[theme]`),
# which should be sufficient for like 99% of use-cases lol.
# pack_directory: app/javascript/packs
# (OPTIONAL) By default the theme will fallback to the default theme
# if a particular pack is not provided. You can specify different
# fallbacks here, or disable fallback behaviours altogether by
# specifying a `null` value.
fallback:

View file

@ -41,9 +41,3 @@ screenshot: images/screenshot.png
# but in the case of the vanilla Mastodon flavour the pack files are
# somewhere else.
pack_directory: app/javascript/packs
# (OPTIONAL) By default the theme will fallback to the default flavour
# if a particular pack is not provided. You can specify different
# fallbacks here, or disable fallback behaviours altogether by
# specifying a `null` value.
fallback: