Is filter an internal variable?

<<filter>>
  • Save, it shows

  -webkit-filter: ;
     -moz-filter: ;
          filter: ;

Why? Is filter an internal variable?

You get strange output when you write

<$list filter=<<filter>> >

</$list>

output

filter:
;

it is because filter seems to be a variable why?

It is used in the core stylesheets which by nessasity are global, but you can safely ignore it and simply set it again, use it as a parameter name etc… but don’t assume its empty unless you make it empty.

Perhaps some of the developers could fix it?

Hi @atronoush the core does indeed define a macro called “filter” for generating CSS filter properties (see the definition here). Therefore it is not recommended to create a global with the name “filter” because it will prevent those CSS filters from working correctly.

Thank you Jeremy!
I have heard/read from official doc, the TW variables are prefixed with tv-
So, it seems there are exceptions.

If the macro is an internal one and should not be called outside the host tiddler, does it make sense to make it nested macro/procedure?

Macros (and procedures and functions) are actually variables but unfortunately the core global macros do not use the tv- prefix.

It is not the case that this is purely an internal macro. It’s part of the suite of CSS macros that the core uses, and that 3rd party stylesheets can also use.

Thank you! I noted this and will avoid using filter as variable.

To be clear, it is using filter as a global variable/macro/procedure/function that you need to avoid, it’s not a problem to have a regular variable called “filter”.