# CSS per nascondere non visti per TL aka. gruppo

**URL:** <https://meta.discourse.org/t/css-to-hide-unseen-per-tl-aka-group/253635>\
**Category:** Development\
**Tags:** css\
**Created:** [1 Febbraio 2023, 7:51am UTC](https://meta.discourse.org/t/css-to-hide-unseen-per-tl-aka-group/253635 "2023-02-01T07:51:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)\
**Post date:** [1 Febbraio 2023, 8:10am UTC](https://meta.discourse.org/t/css-to-hide-unseen-per-tl-aka-group/253635/2 "2023-02-01T08:10:43Z")

</div>

Bene, ho precedentemente sviluppato un componente tematico che può inserire css per gruppi, TL o utenti.

~~Non sono sicuro se qualcuno su meta abbia sviluppato un componente simile prima… ma in caso contrario, lo pubblicherò~~

Aggiornamento: Il principio generale è questo, considerando che la mia implementazione è molto strana… non la pubblicherò

```javascript
<script type="text/discourse-plugin" version="0.8">
try {
    let your_tl = -1; // -1 significa anonimo
    if (api.getCurrentUser()?.trust_level) {
        your_tl = api.getCurrentUser().trust_level;
    }
    if (your_tl < 1) {
        var style = document.createElement('style');
        style.innerHTML = '#tl1-only{display:none;}'; // O qualcos'altro
        document.head.appendChild(style);
    }
} catch(err) {
    // ...
}
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/css-to-hide-unseen-per-tl-aka-group/253635)._
