|
51 | 51 | // Atomic comma style |
52 | 52 | .formula-input-field__comma, |
53 | 53 | .formula-input-field__parenthesis { |
54 | | - color: $palette-cyan-800; |
| 54 | + color: $palette-cyan-900; |
55 | 55 | font-weight: 500; |
56 | 56 | background-color: $palette-cyan-50; |
57 | 57 | padding: 0 8px; |
|
65 | 65 |
|
66 | 66 | // Group parenthesis style |
67 | 67 | .formula-input-field__group-parenthesis { |
68 | | - color: $palette-purple-800; |
| 68 | + color: $palette-purple-900; |
69 | 69 | font-weight: 500; |
70 | 70 | background-color: $palette-purple-50; |
71 | 71 | padding: 0 8px; |
|
82 | 82 | padding-left: 0; |
83 | 83 | } |
84 | 84 |
|
85 | | -// Add margin-right when a function component is followed by another function component |
86 | | -.function-formula-component:has(+ .function-formula-component) { |
87 | | - margin-right: 4px; |
88 | | -} |
89 | | - |
90 | | -// Add margin-right when a function component is followed by a group parenthesis |
91 | | -.function-formula-component:has(+ .formula-input-field__group-parenthesis) { |
92 | | - margin-right: 4px; |
93 | | -} |
94 | | - |
95 | | -// Add margin-right when a parenthesis is followed by another parenthesis |
96 | | -.formula-input-field__parenthesis:has(+ .formula-input-field__parenthesis) { |
97 | | - margin-right: 4px; |
98 | | -} |
99 | | - |
100 | | -// Add margin-right when a parenthesis is followed by a comma |
101 | | -.formula-input-field__parenthesis:has(+ .formula-input-field__comma) { |
102 | | - margin-right: 4px; |
103 | | -} |
104 | | - |
105 | | -// Add margin-right when a comma is followed by a function component |
106 | | -.formula-input-field__comma:has(+ .function-formula-component) { |
107 | | - margin-right: 4px; |
| 85 | +// Spacing between adjacent formula atoms (closing parens, commas, group parens) |
| 86 | +.formula-input-field__parenthesis, |
| 87 | +.formula-input-field__comma, |
| 88 | +.formula-input-field__group-parenthesis { |
| 89 | + &:has( |
| 90 | + + :is( |
| 91 | + .function-formula-component, |
| 92 | + .formula-input-field__parenthesis, |
| 93 | + .formula-input-field__comma, |
| 94 | + .formula-input-field__group-parenthesis |
| 95 | + ) |
| 96 | + ) { |
| 97 | + margin-right: 4px; |
| 98 | + } |
108 | 99 | } |
109 | 100 |
|
110 | | -// Add margin-right when a comma is followed by a parenthesis |
111 | | -.formula-input-field__comma:has(+ .formula-input-field__parenthesis) { |
| 101 | +// Spacing after function components (but not before their own closing paren) |
| 102 | +.function-formula-component:has( |
| 103 | + + :is(.function-formula-component, .formula-input-field__group-parenthesis) |
| 104 | +) { |
112 | 105 | margin-right: 4px; |
113 | 106 | } |
114 | 107 |
|
115 | | -// Add margin-left when a comma is preceded by a function component |
| 108 | +// Spacing before commas preceded by function components |
116 | 109 | .function-formula-component + .formula-input-field__comma { |
117 | 110 | margin-left: 4px; |
118 | 111 | } |
119 | 112 |
|
120 | | -// Add margin-right when a comma is followed by another comma |
121 | | -.formula-input-field__comma:has(+ .formula-input-field__comma) { |
122 | | - margin-right: 4px; |
123 | | -} |
124 | | - |
125 | | -// Add margin-right when a group parenthesis is followed by another group parenthesis |
126 | | -.formula-input-field__group-parenthesis:has( |
127 | | - + .formula-input-field__group-parenthesis |
128 | | -) { |
129 | | - margin-right: 4px; |
130 | | -} |
131 | | - |
132 | | -// Add margin-right when a group parenthesis is followed by a function/operator/comma |
133 | | -.formula-input-field__group-parenthesis:has(+ .function-formula-component), |
134 | | -.formula-input-field__group-parenthesis:has(+ .formula-input-field__comma) { |
| 113 | +// Spacing between closing parens and operators, and between operators and functions |
| 114 | +:is( |
| 115 | + .formula-input-field__parenthesis[data-formula-closing-paren='true'], |
| 116 | + .formula-input-field__group-parenthesis[data-group-closing-paren='true'] |
| 117 | +):has(+ .operator-formula-component), |
| 118 | +.operator-formula-component:has(+ .function-formula-component) { |
135 | 119 | margin-right: 4px; |
136 | 120 | } |
137 | 121 |
|
|
145 | 129 | .formula-input-field__view-full-error { |
146 | 130 | margin-left: 5px; |
147 | 131 | } |
| 132 | + |
| 133 | +// Paren match highlight on hover (disabled for no-arg functions) |
| 134 | +.formula-input-field__paren-highlight:not([data-no-args='true']) { |
| 135 | + &.formula-input-field__parenthesis { |
| 136 | + box-shadow: inset 0 0 0 1.5px $palette-cyan-800; |
| 137 | + } |
| 138 | + |
| 139 | + &.formula-input-field__group-parenthesis { |
| 140 | + box-shadow: inset 0 0 0 1.5px $palette-purple-800; |
| 141 | + } |
| 142 | + |
| 143 | + &.function-formula-component .function-formula-component__name { |
| 144 | + box-shadow: inset 0 0 0 1.5px $palette-cyan-800; |
| 145 | + } |
| 146 | +} |
0 commit comments