The transclusion transcludes the contents of the text field -- it doesn't
know anything about the associated tags.
To make it behave as if it were in its original context you would have to
wrap with same classes it would have seen in it's original settings:
<$list filter="[tag[(B)]]" >
<div data-tags={{{ [all[current]get[tags]] }}} >
<div class="alert-">
<$transclude />
</div></div>
</$list>
Alternatively, the contents of the original tiddler could wrap themselves
in classes in the text.
<div data-tags="(B)" >
Hello. I am <<currentTiddler>>
</div>
This would require you to write an additional CSS selector rule that would
recognize .alert- [attribute selector] as well as the current [attribute
selector] .alert .
[data-tags*="(B)"] .alert- , .alert- [data-tags*="(B)"] { ... }
On Wednesday, February 3, 2021 at 8:43:50 AM UTC-8 [email protected] wrote:
> Hello,
>
> I've modified my styleSheet $:/plugins/kookma/shiraz/styles/ bs/alerts
>
> *Part of the CSS style:*
>
> /*Was taken from bootstrap 4.1.3*/
> .alert {
> position: relative;
> padding: 0.75rem 1.25rem;
> margin-bottom: 1rem;
> border: 1px solid transparent;
> border-radius: 0.25rem;
> }
>
> /*BLUE (PRIMARY)*/
> [data-tags*="(A)"] .alert- {
> color: #004085;
> background-color: #cce5ff;
> border-color: #b8daff;
> }
>
> .alert- hr {
> border-top-color: #9fcdff;
> }
>
> /*GREEN (SUCCESS)*/
> [data-tags*="(B)"] .alert- {
> color: #155724;
> background-color: #d4edda;
> border-color: #c3e6cb;
> }
>
>
>
> Works fine, but if I {{Transclude}} or {{||Transclude}} tiddler (B) in
> Tiddler (A) it automatically reads the tag from Tiddler (A). Which causes
> it to be misrepresented. (Wrong colors) How can I ensure that the correct
> colors are retained?
>
> Thank you,
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/ea79d9da-d399-4220-98e6-e7ba68f6ffc2n%40googlegroups.com.