From 4674ef949fae33b269407d243d5aef1fd5b8f02b Mon Sep 17 00:00:00 2001 From: Frankie Robertson Date: Wed, 7 Aug 2024 14:02:06 +0300 Subject: [PATCH] Add classes for generic usages of (status) field borders --- docs/index.html.ejs | 61 +++++++++++++++++++++++++++++++++++++++++++++ style.css | 21 +++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/docs/index.html.ejs b/docs/index.html.ejs index 088064a..e17934b 100644 --- a/docs/index.html.ejs +++ b/docs/index.html.ejs @@ -44,6 +44,7 @@
  • Tabs
  • TableView
  • Progress Indicator
  • +
  • Field borders
  • Issues, Contributing, etc.
  • @@ -1073,6 +1074,66 @@ +
    +

    Field borders

    +
    +
    + Text boxes, check boxes, drop-down list boxes, spin boxes and list + boxes use the field border style. You can also use the style + for define the work area within a window. It uses the sunken outer and + sunken inner basic border styles. + + For most controls, the interior of the field uses the button highlight + color. For text fields, such as text boxes and combo boxes, the + interior uses the button face color when the field is read-only or + disabled. + +
    + — Microsoft Windows User Experience p. 421 +
    +
    + +
    + Status fields use the status field border style. This style + uses only the sunken outer basic border style. You use the status + field style in status bars and other read-only fields where the + content of the file can change dynamically. + +
    + — Microsoft Windows User Experience p. 422 +
    +
    + + As mentioned in these guidelines, these styles are used in other + contexts than just form elements and status fields such as to indicate + work areas and dynamic content. For that reason, we provide three + classes for these generic usages, field-border, + field-border-disabled, and + status-field-border. These classes only define the border + and background color and minimal padding, so you will typically need to + at least provide some extra padding yourself. + + <%- example(` +
    + Work area +
    + `) %> + + + <%- example(` +
    + Disabled work area +
    + `) %> + + <%- example(` +
    + Dynamic content +
    + `) %> +
    +
    +

    Issues, Contributing, etc.

    diff --git a/style.css b/style.css index 5abea5a..ff82a09 100644 --- a/style.css +++ b/style.css @@ -73,6 +73,7 @@ --border-field: inset -1px -1px var(--button-highlight), inset 1px 1px var(--button-shadow), inset -2px -2px var(--button-face), inset 2px 2px var(--window-frame); + --border-status-field: inset -1px -1px var(--button-face), inset 1px 1px var(--button-shadow); /* Tabs */ --border-tab: inset -1px 0 var(--window-frame), @@ -320,7 +321,7 @@ input[type="reset"]:disabled, } .status-bar-field { - box-shadow: inset -1px -1px #dfdfdf, inset 1px 1px #808080; + box-shadow: var(--border-status-field); flex-grow: 1; padding: 2px 3px; margin: 0; @@ -966,3 +967,21 @@ table > tbody > tr > * { background-repeat: repeat; background-size: 18px 100%; } + +.field-border { + background: var(--button-highlight); + box-shadow: var(--border-field); + padding: 2px; +} + +.field-border-disabled { + background: var(--surface); + box-shadow: var(--border-field); + padding: 2px; +} + +.status-field-border { + background: var(--surface); + box-shadow: var(--border-status-field); + padding: 1px; +}