Шаблон:ColoredTextFrame: различия между версиями

Материал из Space Station 14 Вики
мНет описания правки
мНет описания правки
 
(не показано 10 промежуточных версий этого же участника)
Строка 1: Строка 1:
<div class="frame-text"  
<div class="сolored-frame-text"  
style="
style="
margin:{{{margin|12px 0}}};
margin:{{{margin|12px 0}}};
Строка 7: Строка 7:
--background-alpha:{{{background-alpha|0.1}}};
--background-alpha:{{{background-alpha|0.1}}};
--border-alpha:{{{border-alpha|0.1}}};
--border-alpha:{{{border-alpha|0.1}}};
--lightness-threshold:{{{lightness-threshold|0.3}}};
--lightness-threshold:{{{lightness-threshold|0.1}}};
>
>
<div class="frame-text__header">{{{title}}}</div>
{{#if:{{{title|}}}|<div class="сolored-frame-text__header">{{Anchor|{{{title}}}}}{{{title}}}</div>|}}
<div class="frame-text__content">{{{content}}}</div>
<div class="сolored-frame-text__content list-reset-margin">{{{content}}}</div>
</div><!--
</div><!--


-->{{#css:
--><templatestyles src="ColoredTextFrame/styles.css" />
* {
    --perceived-lightness: calc( ((var(--label-r) * 0.2126) + (var(--label-g) * 0.7152) + (var(--label-b) * 0.0722)) / 255 );
    --lightness-switch: max(0, min(calc((1/(var(--lightness-threshold) - var(--perceived-lightness)))), 1));
   
    --lighten-by: calc(((var(--lightness-threshold) - var(--perceived-lightness)) * 100) * var(--lightness-switch));
}
 
.frame-text {
    display: block;
    font-size: 15px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 0.4em;
 
    background: rgba(var(--label-r), var(--label-g), var(--label-b), var(--background-alpha));
    border-color: rgba(var(--label-r), var(--label-g), var(--label-b), var(--border-alpha));
}
 
.frame-text ol {
    margin: 0.3em 0 0 1.5em;
}
 
.frame-text__header {
    font-weight: bold;
    font-family: "noto sans";
    margin-bottom: 2px;
    color: rgba(
        calc(var(--label-r) + var(--lighten-by)),
        calc(var(--label-g) + var(--lighten-by)),
        calc(var(--label-b) + var(--lighten-by)),
        1
    );
}
 
.frame-text__content {
    color: lightgray;
}
 
.frame-text__content li {
margin-top: {{{margin-li|8px}}};
}
}}

Текущая версия от 15:35, 28 марта 2025

{{{content}}}