Thank you, Andy, but this is not what I have in mind. I know I can do that, but I don't want to remove the System variation but set the default style to Light for guests (no matter what their OS system settings are).You might like this add-on:
https://xenforo.com/community/resources/remove-style-variation-system.9465/
XF\Pub\App
.$styleVariation = $request->getCookie('style_variation', '');
$styleVariation = 'light'
PAGE_CONTAINER
template. <xf:if is="$xf.visitor.canChangeStyleVariation($xf.style)">
<a href="{{ link('misc/style-variation') }}" rel="nofollow"
class="js-styleVariationsLink"
data-xf-init="tooltip" title="{{ phrase('style_variation') }}"
data-xf-click="menu" role="button" aria-expanded="false" aria-haspopup="true">
<xf:fa icon="{{ $xf.style.getVariationIcon($xf.visitor.style_variation) }}" title="{{ phrase('style_variation') }}" />
</a>
<div class="menu" data-menu="menu" aria-hidden="true">
<div class="menu-content js-styleVariationsMenu">
<xf:macro name="style_variation_macros::variation_menu"
arg-style="{$xf.style}"
arg-live="{{ true }}" />
</div>
</div>
</xf:if>
<xf:if is="$xf.visitor.user_id">
<!-- the code above -->
</xf:if>
XF\Entity\User::canChangeStyleVariation()
method. public function canChangeStyleVariation(\XF\Style $style, &$error = null): bool
{
if (!\XF::visitor()->user_id)
{
return false;
}
$styleId = $this->style_id !== 0
? $this->style_id
: $this->app()->options->defaultStyleId;
if ($style->getId() !== $styleId)
{
return false;
}
return $style->isVariationsEnabled();
}
You don't have to use variations. Use extra light and dark style, as you do now.I do get this.
I have put a lot of effort into a style I like for the site. It just happens to be a light style. In the past I've developed sites which are dark. I do now have an option for a dark style that is available for paid subscribers as a bonus (there's also different t coloured light/dark styles)
But now (from 2.3) there is a default switch or system style I don't quite know what I'll do. I think the whole concept of people choosing light /dark in their OS kind of didn't register with me so maybe I should not be making it one or the other by default and continue just let the privileged paying subscribers have the luxury of choosing. OR just automatically allowing it go with their system settings.
I haven't yet decided. Could I be losing users purely because there is no system setting than goes with their preferences? If so that would override the current idea of "subscribe to get what you want."
It's not about what you like more
Although presumably your site would be nothing without users so going out of your way to ignore their preferences is hardly going to be a great start in winning them over.
We use essential cookies to make this site work, and optional cookies to enhance your experience.