2014-06-12 17:01:33 +00:00
|
|
|
title: $:/core/macros/CSS
|
2024-10-22 12:15:34 +00:00
|
|
|
tags: $:/tags/Macro
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2024-11-09 19:03:54 +00:00
|
|
|
\procedure actions-compile-palette-filtered(tempPalette,outputTitle)
|
|
|
|
<!-- Make the colour function use the input palette -->
|
|
|
|
<$let
|
|
|
|
tv-palette-name=<<tempPalette>>
|
|
|
|
>
|
|
|
|
<$list filter="[<tempPalette>indexes[]sort[]]" variable="colour-name">
|
|
|
|
<$let colour-filter={{{ [<tempPalette>getindex<colour-name>] }}}>
|
|
|
|
<!-- Note the join, needed to cope with palette entries containing spaces -->
|
|
|
|
<$action-setfield $tiddler=<<outputTitle>> $index=<<colour-name>> $value={{{ [subfilter<colour-filter>join[ ]] }}}/>
|
|
|
|
</$let>
|
|
|
|
</$list>
|
|
|
|
</$let>
|
|
|
|
\end actions-compile-palette-filtered
|
|
|
|
|
|
|
|
\procedure actions-compile-palette-wikified(tempPalette,outputTitle)
|
|
|
|
<!-- Define our own deeply backwards compatible local versions of the colour macro -->
|
|
|
|
\define colour(name)
|
|
|
|
\whitespace trim
|
|
|
|
<$transclude tiddler=<<tempPalette>> index="$name$">
|
|
|
|
<$transclude tiddler="$:/config/DefaultColourMappings/$name$"/>
|
|
|
|
</$transclude>
|
|
|
|
\end colour
|
|
|
|
\define color(name) <<colour $name$>>
|
|
|
|
<$list filter="[<tempPalette>indexes[]sort[]]" variable="colour-name" $debug="yes">
|
|
|
|
<$wikify name="colour-value" text={{{ [<tempPalette>getindex<colour-name>] }}} mode="inline">
|
|
|
|
<$action-setfield $tiddler=<<outputTitle>> $index=<<colour-name>> $value=<<colour-value>>/>
|
|
|
|
</$wikify>
|
|
|
|
</$list>
|
|
|
|
\end actions-compile-palette-wikified
|
|
|
|
|
|
|
|
\procedure actions-compile-palette(inputTitle,outputTitle,defaultImport="$:/palettes/Vanilla")
|
|
|
|
<$let
|
|
|
|
tempPalette="$:/temp/palette-source"
|
|
|
|
>
|
|
|
|
<!-- Clear the temporary consolidated palette -->
|
|
|
|
<$action-deletetiddler $tiddler=<<tempPalette>>/>
|
|
|
|
<!-- Consolidate the imported palette -->
|
|
|
|
<$let importTitle={{{ [<inputTitle>get[palette-import]else<defaultImport>] }}}>
|
|
|
|
<%if [<importTitle>!match[]] %>
|
|
|
|
<$list filter="[<importTitle>indexes[]sort[]]" variable="colour-name">
|
|
|
|
<$action-setfield $tiddler=<<tempPalette>> $index=<<colour-name>> $value={{{ [<importTitle>getindex<colour-name>] }}}/>
|
|
|
|
</$list>
|
|
|
|
<%endif%>
|
|
|
|
</$let>
|
|
|
|
<!-- Consolidate the main palette -->
|
|
|
|
<$list filter="[<inputTitle>indexes[]sort[]]" variable="colour-name">
|
|
|
|
<$action-setfield $tiddler=<<tempPalette>> $index=<<colour-name>> $value={{{ [<inputTitle>getindex<colour-name>] }}}/>
|
|
|
|
</$list>
|
|
|
|
<!-- Compile the temporary palette to the output palette -->
|
2024-11-09 17:02:00 +00:00
|
|
|
<%if [<inputTitle>get[palette-type]match[modern]] %>
|
2024-11-09 19:03:54 +00:00
|
|
|
<$transclude $variable="actions-compile-palette-filtered" tempPalette=<<tempPalette>> outputTitle=<<outputTitle>>/>
|
2024-11-09 17:02:00 +00:00
|
|
|
<%else%>
|
2024-11-09 19:03:54 +00:00
|
|
|
<$transclude $variable="actions-compile-palette-wikified" tempPalette=<<tempPalette>> outputTitle=<<outputTitle>>/>
|
2024-11-09 17:02:00 +00:00
|
|
|
<%endif%>
|
2024-11-09 19:03:54 +00:00
|
|
|
<!-- Remove the temporary consolidated palette -->
|
|
|
|
<!-- <$action-deletetiddler $tiddler=<<tempPalette>>/> -->
|
2024-11-09 17:02:00 +00:00
|
|
|
</$let>
|
2024-11-09 16:15:33 +00:00
|
|
|
\end actions-compile-palette
|
|
|
|
|
|
|
|
\procedure actions-switch-colour-palette(paletteTitle)
|
2024-11-09 19:03:54 +00:00
|
|
|
\procedure tv-action-refresh-policy() always
|
2024-11-09 16:15:33 +00:00
|
|
|
<$action-deletetiddler $tiddler="$:/temp/palette-colours"/>
|
|
|
|
<$action-setfield $tiddler="$:/palette" $field="text" $value=<<paletteTitle>>/>
|
|
|
|
<$transclude $variable="actions-compile-palette" inputTitle=<<paletteTitle>> outputTitle="$:/temp/palette-colours"/>
|
|
|
|
\end actions-switch-colour-palette
|
|
|
|
|
2024-11-09 17:02:00 +00:00
|
|
|
\procedure tv-palette-name() $:/temp/palette-colours
|
|
|
|
|
2024-11-09 16:15:33 +00:00
|
|
|
\function colour(name)
|
2024-11-09 17:02:00 +00:00
|
|
|
[<tv-palette-name>getindex<name>] :else[[$:/config/DefaultColourMappings/]addsuffix<name>get[text]]
|
2024-11-09 16:15:33 +00:00
|
|
|
\end colour
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2024-11-09 16:15:33 +00:00
|
|
|
\function color(name)
|
|
|
|
[function[colour],<name>]
|
|
|
|
\end color
|
2014-08-18 09:14:19 +00:00
|
|
|
|
2024-10-23 07:21:11 +00:00
|
|
|
\define box-shadow(shadow)
|
|
|
|
``
|
|
|
|
-webkit-box-shadow: $shadow$;
|
|
|
|
-moz-box-shadow: $shadow$;
|
|
|
|
box-shadow: $shadow$;
|
|
|
|
``
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-10-23 07:21:11 +00:00
|
|
|
\define filter(filter)
|
|
|
|
``
|
|
|
|
-webkit-filter: $filter$;
|
|
|
|
-moz-filter: $filter$;
|
|
|
|
filter: $filter$;
|
|
|
|
``
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-10-23 07:21:11 +00:00
|
|
|
\define transition(transition)
|
|
|
|
``
|
|
|
|
-webkit-transition: $transition$;
|
|
|
|
-moz-transition: $transition$;
|
|
|
|
transition: $transition$;
|
|
|
|
``
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-10-23 07:21:11 +00:00
|
|
|
\define transform-origin(origin)
|
|
|
|
``
|
|
|
|
-webkit-transform-origin: $origin$;
|
|
|
|
-moz-transform-origin: $origin$;
|
|
|
|
transform-origin: $origin$;
|
|
|
|
``
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-10-23 07:21:11 +00:00
|
|
|
\define background-linear-gradient(gradient)
|
|
|
|
``
|
|
|
|
background-image: linear-gradient($gradient$);
|
|
|
|
background-image: -o-linear-gradient($gradient$);
|
|
|
|
background-image: -moz-linear-gradient($gradient$);
|
|
|
|
background-image: -webkit-linear-gradient($gradient$);
|
|
|
|
background-image: -ms-linear-gradient($gradient$);
|
|
|
|
``
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-10-23 07:21:11 +00:00
|
|
|
\define column-count(columns)
|
|
|
|
``
|
|
|
|
-moz-column-count: $columns$;
|
|
|
|
-webkit-column-count: $columns$;
|
|
|
|
column-count: $columns$;
|
|
|
|
``
|
2016-08-27 13:24:03 +00:00
|
|
|
\end
|
|
|
|
|
2024-02-14 18:44:22 +00:00
|
|
|
\procedure datauri(title)
|
|
|
|
<$macrocall $name="makedatauri" type={{{ [<title>get[type]] }}} text={{{ [<title>get[text]] }}} _canonical_uri={{{ [<title>get[_canonical_uri]] }}}/>
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-02-14 18:44:22 +00:00
|
|
|
\procedure if-sidebar(text)
|
|
|
|
<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes"><<text>></$reveal>
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
|
|
|
|
2024-02-14 18:44:22 +00:00
|
|
|
\procedure if-no-sidebar(text)
|
|
|
|
<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes"><<text>></$reveal>
|
2014-08-18 09:14:19 +00:00
|
|
|
\end
|
2018-01-23 16:49:24 +00:00
|
|
|
|
2024-02-14 18:44:22 +00:00
|
|
|
\procedure if-background-attachment(text)
|
|
|
|
<$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text=""><<text>></$reveal>
|
2018-01-23 16:49:24 +00:00
|
|
|
\end
|