Skip to content

Commit

Permalink
add documentation for icon_after
Browse files Browse the repository at this point in the history
fixes #348
  • Loading branch information
lovasoa committed May 29, 2024
1 parent 8551e59 commit e5a9649
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- New article by [Matthew Larkin](https://github.com/matthewlarkin) about [migrations](https://sql.ophir.dev/your-first-sql-website/migrations.sql).
- Add a row-level `id` attribute to the button component.
- Static assets (js, css, svg) needed to build SQLPage are now cached individually, and can be downloaded separately from the build process. This makes it easier to build SQLPage without internet access. If you use pre-built SQLPage binaries, this change does not affect you.
- New `icon_after` row-level property in the button component to display an icon on the right of a button (after the text).

## 0.21.0 (2024-05-19)

Expand Down
7 changes: 4 additions & 3 deletions examples/official-site/sqlpage/migrations/18_button.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
('disabled', 'Whether the button is disabled or not.', 'BOOLEAN', FALSE, TRUE),
('outline', 'Outline color of the button (e.g. red, purple, ...)', 'COLOR', FALSE, TRUE),
('space_after', 'Whether there should be extra space to the right of the button. In a line of buttons, this will put the buttons before this one on the left, and the ones after on the right.', 'BOOLEAN', FALSE, TRUE),
('icon_after', 'Name of an icon to display after the text in the button', 'ICON', FALSE, TRUE),
('icon', 'Name of an icon to be displayed on the left side of the button.', 'ICON', FALSE, TRUE),
('form', 'Identifier (id) of the form to which the button should submit.', 'TEXT', FALSE, TRUE),
('id', 'HTML Identifier to add to the button element.', 'TEXT', FALSE, TRUE)
Expand Down Expand Up @@ -57,9 +58,9 @@ INSERT INTO example(component, description, properties) VALUES
INSERT INTO example(component, description, properties) VALUES
('button', 'A row of square buttons with spacing in between',
json('[{"component":"button", "shape":"square"},
{"link":"#", "color":"green", "title":"Save" },
{"link":"#", "color":"orange", "title":"Cancel", "space_after":true},
{"link":"#", "outline":"indigo", "title":"Preview" }]')
{"link":"#", "color":"green", "title":"Save", "icon": "device-floppy" },
{"link":"#", "title":"Cancel", "space_after":true},
{"link":"#", "outline":"indigo", "title":"Preview", "icon_after": "corner-down-right" }]')
);

INSERT INTO example(component, description, properties) VALUES
Expand Down
4 changes: 2 additions & 2 deletions sqlpage/templates/button.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<span class="me-1">{{~icon_img icon~}}</span>
{{~/if~}}
{{~title~}}
{{~#if after_icon~}}
<span class="ms-1">{{~icon_img after_icon~}}</span>
{{~#if icon_after ~}}
<span class="ms-1">{{~icon_img icon_after~}}</span>
{{~/if}}
{{#if form}}
</button>
Expand Down

0 comments on commit e5a9649

Please sign in to comment.