diff --git a/core/palettes/Sky.tid b/core/palettes/Sky.tid new file mode 100644 index 000000000..cc1ef7dce --- /dev/null +++ b/core/palettes/Sky.tid @@ -0,0 +1,80 @@ +title: $:/palettes/Sky +name: Sky +description: Largely blue +tags: $:/tags/Palette +type: application/x-tiddler-dictionary + +primary: #5778D8 +alert-background: #ffe476 +alert-border: #b99e2f +alert-highlight: #881122 +alert-muted-foreground: #b99e2f +background: #f9f9ff +blockquote-bar: <> +code-background: #f7f7f9 +code-border: #e1e1e8 +code-foreground: #dd1144 +download-background: #34c734 +download-foreground: <> +dragger-background: <> +dragger-foreground: <> +dropdown-background: <> +dropdown-border: <> +dropdown-tab-background-selected: #fff +dropdown-tab-background: #ececec +dropzone-background: rgba(0,200,0,0.7) +foreground: #333353 +message-background: #ecf2ff +message-border: #cfd6e6 +message-foreground: #547599 +modal-backdrop: <> +modal-background: <> +modal-border: #999999 +modal-footer-background: #f5f5f5 +modal-footer-border: #dddddd +modal-header-border: #eeeeee +muted-foreground: #999999 +notification-background: #ffffdd +notification-border: #999999 +page-background: #ececfc +pre-background: #f5f5f5 +pre-border: #cccccc +primary: #5778d8 +sidebar-controls-foreground-hover: #000000 +sidebar-controls-foreground: #ffffff +sidebar-foreground: #acacac +sidebar-muted-foreground-hover: #444444 +sidebar-muted-foreground: #c0c0c0 +sidebar-tab-background-selected: #ececec +sidebar-tiddler-link-foreground-hover: #444444 +sidebar-tiddler-link-foreground: #999999 +static-alert-foreground: #aaaaaa +tab-background-selected: #ffffff +tab-background: #d8d8d8 +tab-border-selected: #d8d8d8 +tab-border: #cccccc +tab-divider: #d8d8d8 +tab-foreground: #666666 +table-border: #dddddd +table-footer-background: #a8a8a8 +table-header-background: #f0f0f0 +tag-background: #d5ad34 +tag-foreground: #ffffff +tiddler-background: <> +tiddler-controls-foreground-hover: #888888 +tiddler-controls-foreground-selected: #444444 +tiddler-controls-foreground: #cccccc +tiddler-editor-background: #f8f8f8 +tiddler-editor-border-image: #ffffff +tiddler-editor-border: #cccccc +tiddler-editor-fields-even: #e0e8e0 +tiddler-editor-fields-odd: #f0f4f0 +tiddler-info-background: #f8f8f8 +tiddler-info-border: #dddddd +tiddler-info-tab-background: #f8f8f8 +tiddler-link-background: <> +tiddler-link-foreground: <> +tiddler-subtitle-foreground: #c0c0c0 +tiddler-title-foreground: #182955 +untagged-background: #999999 +very-muted-foreground: #888888 diff --git a/core/palettes/Vanilla.tid b/core/palettes/Vanilla.tid new file mode 100644 index 000000000..c31e4850d --- /dev/null +++ b/core/palettes/Vanilla.tid @@ -0,0 +1,79 @@ +title: $:/palettes/Vanilla +name: Vanilla +description: Pale and unobtrusive +tags: $:/tags/Palette +type: application/x-tiddler-dictionary + +alert-background: #ffe476 +alert-border: #b99e2f +alert-highlight: #881122 +alert-muted-foreground: #b99e2f +background: #ffffff +blockquote-bar: <> +code-background: #f7f7f9 +code-border: #e1e1e8 +code-foreground: #dd1144 +download-background: #34c734 +download-foreground: <> +dragger-background: <> +dragger-foreground: <> +dropdown-background: <> +dropdown-border: <> +dropdown-tab-background-selected: #fff +dropdown-tab-background: #ececec +dropzone-background: rgba(0,200,0,0.7) +foreground: #333333 +message-background: #ecf2ff +message-border: #cfd6e6 +message-foreground: #547599 +modal-backdrop: <> +modal-background: <> +modal-border: #999999 +modal-footer-background: #f5f5f5 +modal-footer-border: #dddddd +modal-header-border: #eeeeee +muted-foreground: #999999 +notification-background: #ffffdd +notification-border: #999999 +page-background: #ececec +pre-background: #f5f5f5 +pre-border: #cccccc +primary: #5778d8 +sidebar-controls-foreground-hover: #000000 +sidebar-controls-foreground: #ffffff +sidebar-foreground: #acacac +sidebar-muted-foreground-hover: #444444 +sidebar-muted-foreground: #c0c0c0 +sidebar-tab-background-selected: #ececec +sidebar-tiddler-link-foreground-hover: #444444 +sidebar-tiddler-link-foreground: #999999 +static-alert-foreground: #aaaaaa +tab-background-selected: #ffffff +tab-background: #d8d8d8 +tab-border-selected: #d8d8d8 +tab-border: #cccccc +tab-divider: #d8d8d8 +tab-foreground: #666666 +table-border: #dddddd +table-footer-background: #a8a8a8 +table-header-background: #f0f0f0 +tag-background: #d5ad34 +tag-foreground: #ffffff +tiddler-background: <> +tiddler-controls-foreground-hover: #888888 +tiddler-controls-foreground-selected: #444444 +tiddler-controls-foreground: #cccccc +tiddler-editor-background: #f8f8f8 +tiddler-editor-border-image: #ffffff +tiddler-editor-border: #cccccc +tiddler-editor-fields-even: #e0e8e0 +tiddler-editor-fields-odd: #f0f4f0 +tiddler-info-background: #f8f8f8 +tiddler-info-border: #dddddd +tiddler-info-tab-background: #f8f8f8 +tiddler-link-background: <> +tiddler-link-foreground: <> +tiddler-subtitle-foreground: #c0c0c0 +tiddler-title-foreground: #182955 +untagged-background: #999999 +very-muted-foreground: #888888 diff --git a/core/ui/ControlPanel/Appearance/Palette.tid b/core/ui/ControlPanel/Appearance/Palette.tid new file mode 100644 index 000000000..aad6b1297 --- /dev/null +++ b/core/ui/ControlPanel/Appearance/Palette.tid @@ -0,0 +1,5 @@ +title: $:/core/ui/ControlPanel/Appearance/Palette +tags: $:/tags/ControlPanel/Appearance +caption: {{$:/language/ControlPanel/Appearance/Palette/Caption}} + +{{$:/snippets/paletteswitcher}} diff --git a/core/wiki/palette.tid b/core/wiki/palette.tid new file mode 100644 index 000000000..afd78912b --- /dev/null +++ b/core/wiki/palette.tid @@ -0,0 +1,3 @@ +title: $:/palette + +$:/palettes/Vanilla \ No newline at end of file diff --git a/core/wiki/paletteswitcher.tid b/core/wiki/paletteswitcher.tid new file mode 100644 index 000000000..eff9cb9d6 --- /dev/null +++ b/core/wiki/paletteswitcher.tid @@ -0,0 +1,9 @@ +title: $:/snippets/paletteswitcher + +\define lingo-base() $:/language/ControlPanel/Appearance/Palette/ +<> <$view tiddler={{$:/palette}} field="name"/> + +<$linkcatcher to="$:/palette"> +<$list filter="[is[shadow]tag[$:/tags/Palette]] [!is[shadow]tag[$:/tags/Palette]] +[sort[description]]">
<$reveal state="$:/palette" type="match" text={{!!title}}>•<$reveal state="$:/palette" type="nomatch" text={{!!title}}>  <$link to={{!!title}}>''<$view field="name" format="text"/>'' - <$view field="description" format="text"/>
+ + \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid b/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid new file mode 100644 index 000000000..d65bc1e20 --- /dev/null +++ b/editions/tw5.com/tiddlers/concepts/ColourPalettes.tid @@ -0,0 +1,43 @@ +created: 20140216102454178 +modified: 20140216102722184 +tags: concepts +title: ColourPalettes +type: text/vnd.tiddlywiki + +Colour palettes bind logical colour names (such as ''page-background'') to actual CSS colours (such as ''#fe0''). + +Entire colour palettes are stored in a single [[data tiddler|DataTiddlers]]. + +The title of the tiddler containing the current colour palette is identified by the tiddler [[$:/palette]]. + +To retrieve a named colour from the current palette you can use the ''colour'' macro: + +``` +<> +``` + +The ''colour'' macro is defined like this: + +``` +\define colour(name) +<$transclude tiddler={{$:/palette}} index="$name$"/> +\end +``` + +By convention, each theme provides a default colour palette in the tiddler [[$:/config/DefaultPalette]] tiddler. Thus, setting the tiddler [[$:/theme]] to the string `$:/config/DefaultPalette` will revert to the palette packaged with the current theme (as long as it hasn't been redefined, since it is a shadow tiddler). + +Palette tiddlers should have the following fields: + +|!Field |!Description | +|title |Any title can be used, typically a system title starting with "$:/" | +|type |`application/x-tiddler-dictionary` to identify this tiddler as a [[data tiddler|DataTiddlers]] | +|tags |`$:/tags/Palette` to identify this tiddler as a palette | +|description |Description to be displayed in palette browser | +|text |Colour definitions (see below) | + +The text of a palette tiddler consists of name value pairs like this: + +``` +foreground: #000 +background: #fff +``` diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 5af64ab30..6e7c50153 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -2,6 +2,9 @@ title: $:/themes/tiddlywiki/vanilla/base tags: [[$:/tags/stylesheet]] \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline +\define colour(name) +<$transclude tiddler={{$:/palette}} index="$name$"/> +\end \define border-radius(radius) ``` -webkit-border-radius: $radius$; @@ -33,8 +36,8 @@ html { body.tw-body { font-size: {{$:/themes/tiddlywiki/vanilla/metrics##fontsize}}; line-height: {{$:/themes/tiddlywiki/vanilla/metrics##lineheight}}; - color: {{$:/themes/tiddlywiki/vanilla/colourmappings##foreground}}; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##pagebackground}}; + color: <>; + background-color: <>; word-wrap: break-word; } @@ -51,23 +54,23 @@ pre { word-wrap: break-word; white-space: pre; white-space: pre-wrap; - background-color: #f5f5f5; - border: 1px solid #ccc; + background-color: <>; + border: 1px solid <>; padding: 0 3px 2px; <> } code { - color: #d14; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; + color: <>; + background-color: <>; + border: 1px solid <>; white-space: pre-wrap; padding: 0 3px 2px; <> } blockquote { - border-left: 5px solid #ddd; + border-left: 5px solid <>; margin-left: 25px; padding-left: 10px; } @@ -88,7 +91,7 @@ pre > code { } table { - border: 1px solid #ddd; + border: 1px solid <>; width: auto; max-width: 100%; caption-side: bottom; @@ -96,17 +99,17 @@ table { table th, table td { padding: 0 7px 0 7px; - border-top: 1px solid #ddd; - border-left: 1px solid #ddd; + border-top: 1px solid <>; + border-left: 1px solid <>; } table thead tr td, table th { - background-color: #f0f0f0; + background-color: <>; font-weight: bold; } table tfoot tr td { - background-color: #a8a8a8; + background-color: <>; } .tw-tiddler-frame img, .tw-tiddler-frame svg, .tw-tiddler-frame canvas, .tw-tiddler-frame embed { @@ -125,16 +128,16 @@ table tfoot tr td { a.tw-tiddlylink { text-decoration: none; font-weight: normal; - color: {{$:/themes/tiddlywiki/vanilla/colourmappings##linkforeground}}; + color: <>; -webkit-user-select: inherit; /* Otherwise the draggable attribute makes links impossible to select */ } .tw-sidebar-lists a.tw-tiddlylink { - color: #999; + color: <>; } .tw-sidebar-lists a.tw-tiddlylink:hover { - color: #444; + color: <>; } a.tw-tiddlylink:hover { @@ -176,17 +179,17 @@ a.tw-tiddlylink-external { font-size: 16.9px; font-weight: bold; line-height: 20px; - color: #fff; + color: <>; text-shadow: 0 1px 0 rgba(0, 0, 0, 1); white-space: nowrap; vertical-align: baseline; - background-color: #000; + background-color: <>; <> } .tw-tiddler-dragger-cover { position: absolute; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##pagebackground}}; + background-color: <>; } .tw-dropzone { @@ -200,7 +203,7 @@ a.tw-tiddlylink-external { top: 0; left: 0; right: 0; - background: rgba(0,200,0,0.7); + background: <>; text-align: center; content: "Drop here"; } @@ -219,26 +222,26 @@ a.tw-tiddlylink-external { .btn-icon svg { height: 1em; width: 1em; - fill: #999; + fill: <>; } .btn-big-green { padding: 8px; margin: 4px 8px 4px 8px; - background: #34C734; - color: #fff; - fill: #fff; + background: <>; + color: <>; + fill: <>; border: none; font-size: 1.2em; line-height: 1.4em; } .btn-mini { - color: #c0c0c0; + color: <>; } .btn-mini:hover { - color: #444; + color: <>; } .tw-image-button { @@ -275,21 +278,21 @@ a.tw-tiddlylink-external { font-size: 0.9em; font-weight: 300; line-height: 1.2em; - color: #fff; + color: <>; white-space: nowrap; vertical-align: baseline; - background-color: #D5AD34; + background-color: <>; <> } .tw-untagged-label { - background-color: #999; + background-color: <>; } .tw-tag-label svg { height: 1em; width: 1em; - fill: #fff; + fill: <>; } /* @@ -297,7 +300,7 @@ a.tw-tiddlylink-external { */ .sidebar-header { - color: #acacac; + color: <>; } .sidebar-header .title a.tw-tiddlylink-resolves { @@ -329,11 +332,11 @@ a.tw-tiddlylink-external { height: 1.75em; min-width: 1px; padding-right: 0.5em; - fill: #fff; + fill: <>; } .tw-page-controls button:hover svg, .tw-page-controls a:hover svg { - fill: #000; + fill: <; } .tw-menu-list-item { @@ -411,19 +414,19 @@ a.tw-tiddlylink-external { .tw-tiddler-frame { margin-bottom: 28px; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##tiddlerbackground}}; + background-color: <>; } .tw-tiddler-info { padding: 14px 42px 14px 42px; - background-color: #f8f8f8; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; + background-color: <>; + border-top: 1px solid <>; + border-bottom: 1px solid <>; } .tw-tiddler-info .tw-tab-buttons button.tw-tab-selected { - background-color: #f8f8f8; - border-bottom: 1px solid #f8f8f8; + background-color: <>; + border-bottom: 1px solid <>; } .tw-view-field-table { @@ -464,7 +467,7 @@ a.tw-tiddlylink-external { font-weight: 300; font-size: 2.35em; line-height: 1.2em; - color: #182955; + color: <>; } .titlebar img { @@ -473,7 +476,7 @@ a.tw-tiddlylink-external { .tw-subtitle { font-size: 0.9em; - color: #c0c0c0; + color: <>; font-weight: 300; } @@ -493,15 +496,15 @@ a.tw-tiddlylink-external { .tw-tiddler-controls button svg { height: 0.75em; - fill: #ccc; + fill: <>; } .tw-tiddler-controls button.tw-selected svg { - fill: #444; + fill: <>; } .tw-tiddler-controls button:hover svg { - fill: #888; + fill: <>; } @media print { @@ -511,29 +514,29 @@ a.tw-tiddlylink-external { } .tw-tiddler-help { /* Help prompts within tiddler template */ - color: #999; + color: <>; margin-top: 14px; } .tw-tiddler-help a.tw-tiddlylink { - color: #888888; + color: <>; } .tw-tiddler-frame input.tw-edit-texteditor, .tw-tiddler-frame textarea.tw-edit-texteditor { width: 100%; padding: 3px 3px 3px 3px; - border: 1px solid #ccc; + border: 1px solid <>; line-height: 1.3em; -webkit-appearance: none; margin: 4px 0 4px 0; } .tw-tiddler-frame input.tw-edit-texteditor { - background-color: #f8f8f8; + background-color: <>; } canvas.tw-edit-bitmapeditor { - border: 6px solid #fff; + border: 6px solid <>; cursor: crosshair; -moz-user-select: none; -webkit-user-select: none; @@ -555,7 +558,7 @@ canvas.tw-edit-bitmapeditor { */ .tw-tiddler-edit-frame em.tw-edit { - color: #999; + color: <>; font-style: normal; } @@ -564,7 +567,7 @@ canvas.tw-edit-bitmapeditor { } .tw-edit-tags { - border: 1px solid #ddd; + border: 1px solid <>; padding: 4px 8px 4px 8px; } @@ -600,7 +603,7 @@ canvas.tw-edit-bitmapeditor { .tw-tiddler-preview-preview { float: right; width: 48%; - border: 1px solid #ccc; + border: 1px solid <>; margin: 4px 3px 3px 3px; padding: 3px 3px 3px 3px; } @@ -620,11 +623,11 @@ canvas.tw-edit-bitmapeditor { } .tw-edit-fields > tbody > .tw-edit-field:nth-child(odd) { - background-color: #f0f4f0; + background-color: <>; } .tw-edit-fields > tbody > .tw-edit-field:nth-child(even) { - background-color: #e0e8e0; + background-color: <>; } .tw-edit-field-name { @@ -641,7 +644,7 @@ canvas.tw-edit-bitmapeditor { .tw-edit-field-remove svg { height: 1em; width: 1em; - fill: #888; + fill: <>; vertical-align: middle; } @@ -662,13 +665,13 @@ canvas.tw-edit-bitmapeditor { .btn-dropdown svg { height: 1em; width: 1em; - fill: #999; + fill: <>; } .tw-drop-down { min-width: 280px; - border: 1px solid {{$:/themes/tiddlywiki/vanilla/colourmappings##dropdownborder}}; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##dropdownbackground}}; + border: 1px solid <>; + background-color: <>; padding: 7px 0 7px 0; margin: 4px 0 0 0; white-space: nowrap; @@ -684,18 +687,18 @@ canvas.tw-edit-bitmapeditor { } .tw-drop-down a:hover { - color: {{$:/themes/tiddlywiki/vanilla/colourmappings##linkbackground}}; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##linkforeground}}; + color: <>; + background-color: <>; text-decoration: none; } .tw-drop-down .tw-tab-buttons button { - background-color: #ececec; + background-color: <>; } .tw-drop-down .tw-tab-buttons button.tw-tab-selected { - background-color: #fff; - border-bottom: 1px solid #fff; + background-color: <>; + border-bottom: 1px solid <>; } .tw-drop-down .tw-tab-contents a { @@ -709,8 +712,8 @@ canvas.tw-edit-bitmapeditor { .tw-block-dropdown { position: absolute; min-width: 280px; - border: 1px solid {{$:/themes/tiddlywiki/vanilla/colourmappings##dropdownborder}}; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##dropdownbackground}}; + border: 1px solid <>; + background-color: <>; padding: 0 0 0 0; margin: 4px 0 0 0; white-space: nowrap; @@ -723,8 +726,8 @@ canvas.tw-edit-bitmapeditor { } .tw-block-dropdown a:hover { - color: {{$:/themes/tiddlywiki/vanilla/colourmappings##linkbackground}}; - background-color: {{$:/themes/tiddlywiki/vanilla/colourmappings##linkforeground}}; + color: <>; + background-color: <>; text-decoration: none; } @@ -739,14 +742,13 @@ canvas.tw-edit-bitmapeditor { bottom: 0; left: 0; z-index: 1000; - background-color: #000; + background-color: <>; } .modal { z-index: 1100; - background-color: #fff; - border: 1px solid #999; - border: 1px solid rgba(0,0,0,.3); + background-color: <>; + border: 1px solid <>; } @media (max-width: 55em) { @@ -775,7 +777,7 @@ canvas.tw-edit-bitmapeditor { .modal-header { padding: 9px 15px; - border-bottom: 1px solid #eee; + border-bottom: 1px solid <>; } .modal-header h3 { @@ -791,8 +793,8 @@ canvas.tw-edit-bitmapeditor { padding: 14px 15px 15px; margin-bottom: 0; text-align: right; - background-color: #f5f5f5; - border-top: 1px solid #ddd; + background-color: <>; + border-top: 1px solid <>; } /* @@ -806,9 +808,8 @@ canvas.tw-edit-bitmapeditor { z-index: 1000; max-width: 280px; padding: 0 14px 0 14px; - background-color: #ffd; - border: 1px solid #999; - border: 1px solid rgba(0,0,0,.3); + background-color: <>; + border: 1px solid <>; } /* @@ -826,7 +827,7 @@ canvas.tw-edit-bitmapeditor { } .tw-tab-buttons button { - color: #666; + color: <>; margin-left: 2px; margin-right: 2px; font-weight: 300; @@ -835,22 +836,22 @@ canvas.tw-edit-bitmapeditor { } .tw-tab-buttons button.tw-tab-selected { - background-color: #fff; - border-left: 1px solid #d8d8d8; - border-top: 1px solid #d8d8d8; - border-right: 1px solid #d8d8d8; + background-color: <>; + border-left: 1px solid <>; + border-top: 1px solid <>; + border-right: 1px solid <>; margin-bottom: -1px; } .tw-tab-buttons button:not(.tw-tab-selected) { - background-color: #d8d8d8; - border-left: 1px solid #ccc; - border-top: 1px solid #ccc; - border-right: 1px solid #ccc; + background-color: <>; + border-left: 1px solid <>; + border-top: 1px solid <>; + border-right: 1px solid <>; } .tw-tab-divider { - border-top: 1px solid #d8d8d8; + border-top: 1px solid <>; } .tw-tab-content { @@ -858,8 +859,8 @@ canvas.tw-edit-bitmapeditor { } .tw-sidebar-lists .tw-tab-buttons button.tw-tab-selected { - background-color: #ececec; - border-bottom: 1px solid #ececec; + background-color: <>; + border-bottom: 1px solid <>; } .tw-sidebar-lists .tw-tab-divider { @@ -904,8 +905,7 @@ canvas.tw-edit-bitmapeditor { } .tw-more-sidebar .tw-tab-buttons button { - background-color: #ececec; - <> + background-color: <>; border-top: none; border-left: none; border-bottom: none; @@ -913,8 +913,7 @@ canvas.tw-edit-bitmapeditor { } .tw-more-sidebar .tw-tab-buttons button.tw-tab-selected { - background-color: #fff; - <> + background-color: <>; border: none; } @@ -934,8 +933,8 @@ canvas.tw-edit-bitmapeditor { position: relative; margin: 28px; padding: 14px 14px 14px 14px; - border: 2px solid #B99E2F; - background-color: rgb(255, 228, 118); + border: 2px solid <>; + background-color: <>; } .tw-alert-toolbar { @@ -945,16 +944,16 @@ canvas.tw-edit-bitmapeditor { } .tw-alert-toolbar svg { - fill: #B99E2F; + fill: <>; } .tw-alert-subtitle { - color: #B99E2F; + color: <>; font-weight: bold; } .tw-alert-highlight { - color: #812; + color: <>; } .tw-static-alert { @@ -963,7 +962,7 @@ canvas.tw-edit-bitmapeditor { .tw-static-alert-inner { padding: 0 2px 2px 42px; - color: #AAA; + color: <>; position: absolute; } @@ -993,13 +992,13 @@ canvas.tw-edit-bitmapeditor { */ .tw-message-box { - border: 1px solid #CFD6E6; - background: #ECF2FF; + border: 1px solid <>; + background: <>; padding: 0px 21px 0px 21px; margin: 0 -21px 0 -21px; font-size: 12px; line-height: 18px; - color: #547599; + color: <>; } .tw-message-box img {