1package lipgloss
  2
  3// unset unsets a property from a style.
  4func (s *Style) unset(key propKey) {
  5	s.props = s.props.unset(key)
  6}
  7
  8// UnsetBold removes the bold style rule, if set.
  9func (s Style) UnsetBold() Style {
 10	s.unset(boldKey)
 11	return s
 12}
 13
 14// UnsetItalic removes the italic style rule, if set.
 15func (s Style) UnsetItalic() Style {
 16	s.unset(italicKey)
 17	return s
 18}
 19
 20// UnsetUnderline removes the underline style rule, if set.
 21func (s Style) UnsetUnderline() Style {
 22	s.unset(underlineKey)
 23	return s
 24}
 25
 26// UnsetStrikethrough removes the strikethrough style rule, if set.
 27func (s Style) UnsetStrikethrough() Style {
 28	s.unset(strikethroughKey)
 29	return s
 30}
 31
 32// UnsetReverse removes the reverse style rule, if set.
 33func (s Style) UnsetReverse() Style {
 34	s.unset(reverseKey)
 35	return s
 36}
 37
 38// UnsetBlink removes the blink style rule, if set.
 39func (s Style) UnsetBlink() Style {
 40	s.unset(blinkKey)
 41	return s
 42}
 43
 44// UnsetFaint removes the faint style rule, if set.
 45func (s Style) UnsetFaint() Style {
 46	s.unset(faintKey)
 47	return s
 48}
 49
 50// UnsetForeground removes the foreground style rule, if set.
 51func (s Style) UnsetForeground() Style {
 52	s.unset(foregroundKey)
 53	return s
 54}
 55
 56// UnsetBackground removes the background style rule, if set.
 57func (s Style) UnsetBackground() Style {
 58	s.unset(backgroundKey)
 59	return s
 60}
 61
 62// UnsetWidth removes the width style rule, if set.
 63func (s Style) UnsetWidth() Style {
 64	s.unset(widthKey)
 65	return s
 66}
 67
 68// UnsetHeight removes the height style rule, if set.
 69func (s Style) UnsetHeight() Style {
 70	s.unset(heightKey)
 71	return s
 72}
 73
 74// UnsetAlign removes the horizontal and vertical text alignment style rule, if set.
 75func (s Style) UnsetAlign() Style {
 76	s.unset(alignHorizontalKey)
 77	s.unset(alignVerticalKey)
 78	return s
 79}
 80
 81// UnsetAlignHorizontal removes the horizontal text alignment style rule, if set.
 82func (s Style) UnsetAlignHorizontal() Style {
 83	s.unset(alignHorizontalKey)
 84	return s
 85}
 86
 87// UnsetAlignVertical removes the vertical text alignment style rule, if set.
 88func (s Style) UnsetAlignVertical() Style {
 89	s.unset(alignVerticalKey)
 90	return s
 91}
 92
 93// UnsetPadding removes all padding style rules.
 94func (s Style) UnsetPadding() Style {
 95	s.unset(paddingLeftKey)
 96	s.unset(paddingRightKey)
 97	s.unset(paddingTopKey)
 98	s.unset(paddingBottomKey)
 99	s.unset(paddingCharKey)
100	return s
101}
102
103// UnsetPaddingChar removes the padding character style rule, if set.
104func (s Style) UnsetPaddingChar() Style {
105	s.unset(paddingCharKey)
106	return s
107}
108
109// UnsetPaddingLeft removes the left padding style rule, if set.
110func (s Style) UnsetPaddingLeft() Style {
111	s.unset(paddingLeftKey)
112	return s
113}
114
115// UnsetPaddingRight removes the right padding style rule, if set.
116func (s Style) UnsetPaddingRight() Style {
117	s.unset(paddingRightKey)
118	return s
119}
120
121// UnsetPaddingTop removes the top padding style rule, if set.
122func (s Style) UnsetPaddingTop() Style {
123	s.unset(paddingTopKey)
124	return s
125}
126
127// UnsetPaddingBottom removes the bottom padding style rule, if set.
128func (s Style) UnsetPaddingBottom() Style {
129	s.unset(paddingBottomKey)
130	return s
131}
132
133// UnsetColorWhitespace removes the rule for coloring padding, if set.
134func (s Style) UnsetColorWhitespace() Style {
135	s.unset(colorWhitespaceKey)
136	return s
137}
138
139// UnsetMargins removes all margin style rules.
140func (s Style) UnsetMargins() Style {
141	s.unset(marginLeftKey)
142	s.unset(marginRightKey)
143	s.unset(marginTopKey)
144	s.unset(marginBottomKey)
145	return s
146}
147
148// UnsetMarginLeft removes the left margin style rule, if set.
149func (s Style) UnsetMarginLeft() Style {
150	s.unset(marginLeftKey)
151	return s
152}
153
154// UnsetMarginRight removes the right margin style rule, if set.
155func (s Style) UnsetMarginRight() Style {
156	s.unset(marginRightKey)
157	return s
158}
159
160// UnsetMarginTop removes the top margin style rule, if set.
161func (s Style) UnsetMarginTop() Style {
162	s.unset(marginTopKey)
163	return s
164}
165
166// UnsetMarginBottom removes the bottom margin style rule, if set.
167func (s Style) UnsetMarginBottom() Style {
168	s.unset(marginBottomKey)
169	return s
170}
171
172// UnsetMarginBackground removes the margin's background color. Note that the
173// margin's background color can be set from the background color of another
174// style during inheritance.
175func (s Style) UnsetMarginBackground() Style {
176	s.unset(marginBackgroundKey)
177	return s
178}
179
180// UnsetBorderStyle removes the border style rule, if set.
181func (s Style) UnsetBorderStyle() Style {
182	s.unset(borderStyleKey)
183	return s
184}
185
186// UnsetBorderTop removes the border top style rule, if set.
187func (s Style) UnsetBorderTop() Style {
188	s.unset(borderTopKey)
189	return s
190}
191
192// UnsetBorderRight removes the border right style rule, if set.
193func (s Style) UnsetBorderRight() Style {
194	s.unset(borderRightKey)
195	return s
196}
197
198// UnsetBorderBottom removes the border bottom style rule, if set.
199func (s Style) UnsetBorderBottom() Style {
200	s.unset(borderBottomKey)
201	return s
202}
203
204// UnsetBorderLeft removes the border left style rule, if set.
205func (s Style) UnsetBorderLeft() Style {
206	s.unset(borderLeftKey)
207	return s
208}
209
210// UnsetBorderForeground removes all border foreground color styles, if set.
211func (s Style) UnsetBorderForeground() Style {
212	s.unset(borderTopForegroundKey)
213	s.unset(borderRightForegroundKey)
214	s.unset(borderBottomForegroundKey)
215	s.unset(borderLeftForegroundKey)
216	return s
217}
218
219// UnsetBorderTopForeground removes the top border foreground color rule,
220// if set.
221func (s Style) UnsetBorderTopForeground() Style {
222	s.unset(borderTopForegroundKey)
223	return s
224}
225
226// UnsetBorderRightForeground removes the right border foreground color rule,
227// if set.
228func (s Style) UnsetBorderRightForeground() Style {
229	s.unset(borderRightForegroundKey)
230	return s
231}
232
233// UnsetBorderBottomForeground removes the bottom border foreground color
234// rule, if set.
235func (s Style) UnsetBorderBottomForeground() Style {
236	s.unset(borderBottomForegroundKey)
237	return s
238}
239
240// UnsetBorderLeftForeground removes the left border foreground color rule,
241// if set.
242func (s Style) UnsetBorderLeftForeground() Style {
243	s.unset(borderLeftForegroundKey)
244	return s
245}
246
247// UnsetBorderBackground removes all border background color styles, if
248// set.
249func (s Style) UnsetBorderBackground() Style {
250	s.unset(borderTopBackgroundKey)
251	s.unset(borderRightBackgroundKey)
252	s.unset(borderBottomBackgroundKey)
253	s.unset(borderLeftBackgroundKey)
254	return s
255}
256
257// UnsetBorderTopBackgroundColor removes the top border background color rule,
258// if set.
259//
260// Deprecated: This function simply calls Style.UnsetBorderTopBackground.
261func (s Style) UnsetBorderTopBackgroundColor() Style {
262	return s.UnsetBorderTopBackground()
263}
264
265// UnsetBorderTopBackground removes the top border background color rule,
266// if set.
267func (s Style) UnsetBorderTopBackground() Style {
268	s.unset(borderTopBackgroundKey)
269	return s
270}
271
272// UnsetBorderRightBackground removes the right border background color
273// rule, if set.
274func (s Style) UnsetBorderRightBackground() Style {
275	s.unset(borderRightBackgroundKey)
276	return s
277}
278
279// UnsetBorderBottomBackground removes the bottom border background color
280// rule, if set.
281func (s Style) UnsetBorderBottomBackground() Style {
282	s.unset(borderBottomBackgroundKey)
283	return s
284}
285
286// UnsetBorderLeftBackground removes the left border color rule, if set.
287func (s Style) UnsetBorderLeftBackground() Style {
288	s.unset(borderLeftBackgroundKey)
289	return s
290}
291
292// UnsetInline removes the inline style rule, if set.
293func (s Style) UnsetInline() Style {
294	s.unset(inlineKey)
295	return s
296}
297
298// UnsetMaxWidth removes the max width style rule, if set.
299func (s Style) UnsetMaxWidth() Style {
300	s.unset(maxWidthKey)
301	return s
302}
303
304// UnsetMaxHeight removes the max height style rule, if set.
305func (s Style) UnsetMaxHeight() Style {
306	s.unset(maxHeightKey)
307	return s
308}
309
310// UnsetTabWidth removes the tab width style rule, if set.
311func (s Style) UnsetTabWidth() Style {
312	s.unset(tabWidthKey)
313	return s
314}
315
316// UnsetUnderlineSpaces removes the value set by UnderlineSpaces.
317func (s Style) UnsetUnderlineSpaces() Style {
318	s.unset(underlineSpacesKey)
319	return s
320}
321
322// UnsetStrikethroughSpaces removes the value set by StrikethroughSpaces.
323func (s Style) UnsetStrikethroughSpaces() Style {
324	s.unset(strikethroughSpacesKey)
325	return s
326}
327
328// UnsetTransform removes the value set by Transform.
329func (s Style) UnsetTransform() Style {
330	s.unset(transformKey)
331	return s
332}
333
334// UnsetString sets the underlying string value to the empty string.
335func (s Style) UnsetString() Style {
336	s.value = ""
337	return s
338}