@hattisar/design-tokens 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tokens.css +44 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hattisar/design-tokens",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Shared design tokens (colors, type, radius, spacing, motion) and base primitives (reset, buttons, inputs, cards, modals, auth shell) for every Hattisar frontend.",
|
|
5
5
|
"main": "tokens.css",
|
|
6
6
|
"files": [
|
package/tokens.css
CHANGED
|
@@ -1032,6 +1032,50 @@ input[type="date"]::-webkit-calendar-picker-indicator:hover {
|
|
|
1032
1032
|
* picker in the app is a Combobox underneath, so this is the
|
|
1033
1033
|
* difference between one red label on a form and all of them.
|
|
1034
1034
|
*/
|
|
1035
|
+
/*
|
|
1036
|
+
* And a star after the label text, the way Zoho marks a required
|
|
1037
|
+
* field.
|
|
1038
|
+
*
|
|
1039
|
+
* Harder than it looks, because the label's text is a bare text node:
|
|
1040
|
+
* `<label>First Name<input required></label>`. A plain `label::after`
|
|
1041
|
+
* renders after *everything* in the label — under the input, not
|
|
1042
|
+
* beside the words — and the only way to attach it to the text
|
|
1043
|
+
* directly would be to wrap that text in a span on every field of
|
|
1044
|
+
* every form.
|
|
1045
|
+
*
|
|
1046
|
+
* So the label becomes a wrapping flex row for required fields only,
|
|
1047
|
+
* and the three items are ordered explicitly: the text (order 0, an
|
|
1048
|
+
* anonymous flex item), the star (order 1), then the control, forced
|
|
1049
|
+
* onto the next line by a full-width basis. The result is the text and
|
|
1050
|
+
* its star on one line and the field under them — which is what the
|
|
1051
|
+
* label already looked like, with a star added and no markup touched.
|
|
1052
|
+
*/
|
|
1053
|
+
label:has(:required) {
|
|
1054
|
+
/*
|
|
1055
|
+
* !important because 212 labels in this app carry an inline
|
|
1056
|
+
* `style={{ display: "block" }}`, and an inline declaration beats
|
|
1057
|
+
* any stylesheet rule regardless of specificity. This is the case
|
|
1058
|
+
* the keyword exists for: overriding markup a stylesheet cannot
|
|
1059
|
+
* reach. Without it the star renders after the control on every one
|
|
1060
|
+
* of those labels instead of beside the words.
|
|
1061
|
+
*/
|
|
1062
|
+
display: flex !important;
|
|
1063
|
+
flex-wrap: wrap;
|
|
1064
|
+
align-items: baseline;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
label:has(:required) > * {
|
|
1068
|
+
order: 2;
|
|
1069
|
+
flex-basis: 100%;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
label:has(:required)::after {
|
|
1073
|
+
content: "*";
|
|
1074
|
+
order: 1;
|
|
1075
|
+
margin-left: 2px;
|
|
1076
|
+
color: var(--color-danger);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1035
1079
|
label:has(:required) {
|
|
1036
1080
|
color: var(--color-danger);
|
|
1037
1081
|
}
|