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:
parent
62bc36416f
commit
9a8be8cf49
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user