feat: switch button label between view modes

This commit is contained in:
Sebin Nyshkim 2025-06-22 02:55:50 +02:00
parent 26977635bd
commit 167f86922f

View file

@ -23,7 +23,8 @@
</div> </div>
<ref-button class="nsfw-toggle" command="show-modal" commandfor="nsfw-warning"> <ref-button class="nsfw-toggle" command="show-modal" commandfor="nsfw-warning">
Reveal/Hide <span>Show NSFW</span>
<span class="nsfw-label">Hide NSFW</span>
</ref-button> </ref-button>
<div class="nsfw-content"> <div class="nsfw-content">
@ -35,12 +36,22 @@
<style webc:scoped="nsfw-barrier"> <style webc:scoped="nsfw-barrier">
:host { :host {
.nsfw & .nsfw-content { .nsfw & :where(.nsfw-content) {
display: block; display: block;
} }
.nsfw & .nsfw-toggle .nsfw-label {
display: block;
}
.nsfw & .nsfw-toggle :not(.nsfw-label) {
display: none;
}
} }
:host .nsfw-content { :host .nsfw-toggle {
text-align: end;
}
:host :where(.nsfw-content, .nsfw-label) {
display: none; display: none;
} }
</style> </style>