--- /dev/null
+# frozen_string_literal: true
+
+module StyleHelper
+ def stylesheet_for_layout
+ if asset_exist? 'custom.css'
+ 'custom'
+ else
+ 'application'
+ end
+ end
+
+ def asset_exist?(path)
+ true if Webpacker::Manifest.lookup(path)
+ rescue Webpacker::FileLoader::NotFoundError
+ false
+ end
+end
const perf = require('./performance');
-// allow override variables here
-require.context('../../assets/stylesheets/', false, /variables.*\.scss$/);
-
// import default stylesheet with variables
require('font-awesome/css/font-awesome.css');
require('../styles/application.scss');
require.context('../images/', true);
- // import customization styles
- require.context('../../assets/stylesheets/', false, /custom.*\.scss$/);
-
onDomContentLoaded(() => {
const mountNode = document.getElementById('mastodon');
const props = JSON.parse(mountNode.getAttribute('data-props'));
= ' - '
= title
- = stylesheet_pack_tag 'application', media: 'all'
+ = stylesheet_pack_tag 'common', media: 'all'
+ = stylesheet_pack_tag stylesheet_for_layout, media: 'all'
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
= javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
= csrf_meta_tags