1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-20 08:44:52 +00:00
TiddlyWiki5/core/wiki
Mateusz Wilczek db6b4f17e8
Improve translink macro, fixes 4877 (#7425)
* Improve translink macro

Changes:
- Change styles to adapt colours to the current palette, instead of hard-coded white inside black box with grey borders.
- Simplify the design to a single div (inspired by the Community links on tiddlywiki.com), instead of two nested contrasting divs.

Comments:
- I found pre-border and pre-background to be the most consistently readable across the default palettes (better than relying on e.g. tiddler-border, tiddler-background, page-background, code-border, code-background). Cupertino Dark, Gruvbox Dark, Nord, Solar Flare, Spartan Day, Spartan Night, Spartan Day, and Twilight have same or very similar pre-border and pre-background colours, so if the macro is nested (translinking a tiddler that contains a translink), the inner frames are not distinguishable, but I think it's an acceptable edge case.
- Padding is defined separately for block and inline modes of the macro to make it appear consistent.

* Update translink macro

Change the `<h1>` styling so that it is only applied to the transcluded tiddler's title and not to any potential `<h1>` in its text.

* Update translink macro

Change the class-constructing filter so that the empty message is displayed with consistent padding in block mode.

* Update translink.tid

* Add styles for translink macro to vanilla/base.tid

Split `pre` element styling, to allow part of it be reused with `.tc-pre-border` (used by translink macro).
Add `.tc-big-bold` class under Other utility classes (used by translink macro).

* Update base.tid

Add `.tc-big-bold` class under Other utility classes (used by translink macro).

* Update translink.tid

Update `tc-pre-border` class name to match the one in vanilla/base.tid

* Update translink.tid

Simplify by always wrapping transclusion in `<p>` element (adjusts padding when inline mode or tiddler missing).

* Update translink.tid

Localise missing tiddler message (`$:/language/MissingTiddler/Hint`)

* Update vanilla/base.tid

- Modify class `tc-pre-background`, so that it can be applied to elements other than `pre`. The styling of `pre` remains unchanged, it is only split into two parts, for one part to be reused in the `tc-pre-background` class (used e.g. in translink macro).
- Add `tc-big-v-gap` and `tc-big-bold` in the *Other utility classes* section (used e.g. in translink macro).

* Update translink.tid

Improve styling to depend only on classes specified in vanilla/base.tid

* Update base.tid

Update class `tc-translink` and CSS selectors to make styling the translink macro easier

* Update translink.tid

Change the classes of elements, so that changing the style is possible by modifying the stylesheet only

* Update base.tid

Add selectors to support new inline mode in translink macro

* Update translink.tid

Change behaviour of the inline mode, now the whole macro is inline, not just the transcluded text.

* Update base.tid

Fix padding of tc-translink class to account for multiline inline content.

* Update base.tid

Remove pseudo-element parentheses from inline translink macro

* Update translink.tid

Add parentheses around inline macro
2023-05-10 21:57:15 +01:00
..
config Introduce $:/tags/Global tag 2023-05-09 15:46:54 +01:00
macros Improve translink macro, fixes 4877 (#7425) 2023-05-10 21:57:15 +01:00
tags Add layout switcher page control button (#7076) 2022-12-04 16:25:13 +00:00
advancedsearch.tid First pass at an advanced search tiddler 2013-12-31 13:11:01 +00:00
allfields.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
currpalettepreview.tid Trim Saga: Making existing trim tiddlers consistent (#6272) 2022-03-26 15:18:42 +00:00
debugstylesheets.tid Another batch of whitespace trims (#6587) 2022-04-05 16:48:07 +01:00
DefaultTiddlers.tid Simpler default defaulttiddlers 2014-08-18 10:27:48 +01:00
download-wiki-button.tid Make save wiki button be accessible to users without colour vision (#7232) 2023-01-28 09:51:25 +00:00
language.tid Ensure we have a default language in empty.html 2014-08-14 12:00:07 +01:00
languageswitcher.tid Trim saga: The big macros (#6269) 2022-04-01 12:09:59 +01:00
minifocusswitcher.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
minilanguageswitcher.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
minithemeswitcher.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
modules.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
palette.tid First pass at switchable colour palettes 2014-02-17 12:09:10 +00:00
paletteeditor.tid Add/refactor PaletteManager (#3832) 2019-06-26 12:36:13 +01:00
palettepreview.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
paletteswitcher.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
peek-stylesheets.tid Show stylesheets as rendered plain text with highlighting (#6778) 2022-07-14 09:00:56 +01:00
search.tid Use temporary tiddler for search text 2012-11-11 15:08:46 +00:00
themeswitcher.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00
title.tid Another batch of whitespace trims (#6587) 2022-04-05 16:48:07 +01:00
view.tid Retract inadvertant change from previous commit 2014-05-26 22:56:58 +01:00
viewswitcher.tid Trim Saga: All snippets, language tiddlers, and typed (#6275) 2022-04-01 12:10:29 +01:00