Commit Graph

46 Commits

Author SHA1 Message Date
Christian Rocha
9f111af5aa
chore(lint): add nolint directives 2024-05-01 15:59:11 -04:00
Ayman Bagabas
387f2d73e8
refactor: replace props map with struct fields
Use an int to store property existence and style struct fields to store
the actual values for each non-bool property.

Fixes: https://github.com/charmbracelet/lipgloss/pull/139
Fixes: https://github.com/charmbracelet/lipgloss/pull/141
2024-03-28 17:47:40 -04:00
Christian Rocha
d354842a40
feat: Style.Transform for altering strings at render time (#232)
* feat: Style.Transform for altering strings at render time

* feat: add `UnsetTransform`

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-11-27 14:33:38 -05:00
Julien Ammous
59fcf6fa80
fix(align): fixed help comment (#239) 2023-11-22 15:16:16 -05:00
Christian Rocha
01248034d0
chore(lint): add various nolint directives (#206)
Generally run-of-the-mill directives to disable magic number and exhaustive switches. Reasonings should be self explanatory while reading the code and comments, where applicable.
2023-07-24 11:50:04 -04:00
Christian Rocha
df8b3fa1f2
feat: convert tabs to spaces with Style.TabWidth(int) (#204)
* feat: convert tabs to spaces with Style.TabWidth(int)

By default tabs will be converted to 4 spaces. To disable tab
conversion set Style.TabWidth(NoTabConversion).
2023-07-24 11:22:48 -04:00
Glenn Gonda
303724f7da
docs: fix typos and clean up comments (#182) 2023-03-12 11:04:42 +01:00
Ayman Bagabas
c5382b35ef ref(renderer): change renderer impl 2023-03-08 09:54:27 -08:00
István Donkó
1eab58f1d8 docs: fix the description of MaxHeight 2023-03-01 13:58:42 +01:00
nervo
1c1240fd65
docs: fix various typos (#156) 2022-11-08 10:55:11 +01:00
Victor/Alyx Bersy
9ee8b6e19f
feat: add BlockBorder, OuterHalfBlockBorder, and InnerHalfBlockBorder border styles (#120) 2022-10-27 15:02:57 -04:00
Will Winder
3dd9f0bfb8 docs: minor fixes to comments 2022-10-15 15:40:38 -04:00
Maas Lalani
0ce5550901 feat: Align takes multiple arguments for setting horizontal + vertical alignment 2022-09-06 14:11:09 -04:00
Maas Lalani
9852bb3017 feat: VerticalAlign
Add VerticalAlign, UnsetVerticalAlign, etc...
2022-09-06 14:11:09 -04:00
Christian Rocha
2cb1d4a5c1 docs(lint): update example code in GoDocs per new style standard
This revision was made automatically via 'golangci-lint run --fix'
2022-08-24 09:22:45 -07:00
Luka Markušić
f651363297 Fix height doc (width -> height) 2022-08-24 08:48:32 -07:00
Christian Rocha
514fa059f3 Fix and generally improve various doc comments 2022-02-14 11:43:23 -05:00
Christian Rocha
200b8d839f Revert "Keep margins, padding, widths, and heights positive"
This reverts commit 64fb44b31b.
2021-04-12 16:50:41 -04:00
Christian Rocha
64fb44b31b Keep margins, padding, widths, and heights positive 2021-04-12 16:44:37 -04:00
Christian Rocha
bb42143109 Remove 'Color' suffix from border FG/BG API methods
This makes the border API better match the rest of the API. Also, the
'Color' part is implicit.
2021-04-07 12:23:36 -04:00
Kiyon
90ec1a88d1 Fix typos in set 2021-04-06 08:23:35 +02:00
Christian Rocha
cdba8ecd00 Fix a typo in the Inline doc comment 2021-04-05 11:22:17 -04:00
Christian Rocha
f7f21906fd
Just expose the API for setting the margin color. 2021-04-02 10:24:42 -04:00
Christian Rocha
3b2c9574ca
Remove the gaps and add the periods that the linter wants 2021-04-02 10:22:28 -04:00
Christian Rocha
31b52762a4
Style.Inline() now skips over padding, margins and borders entirely 2021-03-31 09:55:21 -04:00
Christian Rocha
9b77d4607b
Rename ColorType to TerminalColor 2021-03-30 22:19:38 -04:00
Christian Rocha
34d6f0c73b
Make map before inheriting 2021-03-30 22:15:28 -04:00
Christian Rocha
cb8b96556e
Margins inherit background color 2021-03-30 22:15:28 -04:00
Christian Rocha
0cd4e2cc7f
Fix naming on padding setters 2021-03-30 13:05:39 -04:00
Christian Rocha
5b43b10fd6
Add utility for horizontally and vertically placing blocks in whitespace 2021-03-26 13:35:48 -04:00
Christian Rocha
a47a89f4ae
Remove setting for underlining and striking whitespace 2021-03-26 10:36:23 -04:00
Christian Rocha
a3ab90a71c
Remove setting for not drawing trailing spaces 2021-03-26 09:30:54 -04:00
Christian Rocha
d7bd9ebc4f
Borders are back 2021-03-25 20:43:40 -04:00
Christian Rocha
5a330d1ea7
Keep our integers above zero (let's not move to uints just yet) 2021-03-24 17:29:01 -04:00
Christian Rocha
c9fa4cd62e
Make margin setters match CSS naming 2021-03-24 16:31:35 -04:00
Christian Rocha
7b5208a1cd
Add Height and MaxHeight properties 2021-03-24 14:42:45 -04:00
Christian Rocha
acd9df30a7
Change margin and padding APIs to closer match CSS 2021-03-24 13:55:43 -04:00
Christian Rocha
0732c59a2e
Improve some GoDocs 2021-03-17 20:29:18 -04:00
Christian Rocha
6bfa4297a0
Style.Inline and Style.MaxWidth no longer mutate the style 2021-03-17 14:27:09 -04:00
Christian Rocha
303947c10c
Implement the Stringer interface for the Style type 2021-03-17 14:27:09 -04:00
Christian Rocha
48b02286d8
Clothe the returns, such that they will no longer be naked 2021-03-12 12:31:42 -05:00
Christian Rocha
cbe446f299
GoDocs and GoDoc spelling corrections 2021-03-10 10:21:21 -05:00
Christian Rocha
228d50837b
Switch to a map-based implementation to make things less complicated 2021-03-08 09:00:42 -05:00
Christian Rocha
53b7cb3cdb
Rules for underlines/strikethroughs relating to spaces between words 2021-03-05 16:34:46 -05:00
Christian Rocha
4665de69d0
Rework renderer 2021-03-05 12:43:51 -05:00
Christian Rocha
62aaaf35ef
Move style setters into a separate file 2021-03-05 10:07:00 -05:00