Skip to content

Commit c0efd14

Browse files
committed
fix icon overflowing text in card component
fixes #424
1 parent 11ed4fa commit c0efd14

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
- ![compact list screenshot](https://github.com/lovasoa/SQLpage/assets/552629/41302807-c6e4-40a0-9486-bfd0ceae1537)
1818
- Add property `narrow` to the [button](https://sql.ophir.dev/documentation.sql?component=button#component) component to make the button narrower. Ideal for buttons with icons.
1919
- ![icon buttons](https://github.com/lovasoa/SQLpage/assets/552629/7fcc049e-6012-40c1-a8ee-714ce70a8763)
20+
- new `tooltip` property in the datagrid component.
21+
- datagrids are now slightly more compact, with less padding and less space taken by each item.
22+
- fix a bug in the [card](https://sql.ophir.dev/documentation.sql?component=card#component) component where the icon would sometimes overflow the card's text content.
2023

2124
## 0.23.0 (2024-06-09)
2225

examples/official-site/sqlpage/migrations/31_card_docs_update.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ INSERT INTO example(component, description, properties) VALUES
5151
{"title": "Download as spreadsheet", "link": "?component=csv#component", "description": "Using the CSV component, you can download your data as a spreadsheet.", "icon":"file-plus", "color": "green", "footer_md": "SQLPage can both [read](?component=form#component) and [write](?component=csv#component) **CSV** files."},
5252
{"title": "Custom components", "link": "/custom_components.sql", "description": "If you know some HTML, you can create your own components for your application.", "icon":"code", "color": "orange", "footer_md": "You can look at the [source of the official components](https://github.com/lovasoa/SQLpage/tree/main/sqlpage/templates) for inspiration."}
5353
]')),
54+
('card', 'Short information notices',
55+
json('[
56+
{"component": "card"},
57+
{"description_md": "This post is also available in [german](?lang=de).", "active": true, "icon": "language"}
58+
]')),
5459
('card', 'A gallery of images.',
5560
json('[
5661
{"component":"card", "title":"My favorite animals in pictures", "columns": 3},

sqlpage/templates/card.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{{/if}}
4040
<div class="card-body">
4141
{{#if title}}<h2 class="card-title fs-3 me-3">{{title}}</h2>{{/if}}
42-
<div class="card-content remove-bottom-margin">
42+
<div class="card-content remove-bottom-margin{{#if (and icon (not title))}} pe-4{{/if}}">
4343
{{~description~}}
4444
{{~#if description_md~}}
4545
{{{markdown description_md}}}

0 commit comments

Comments
 (0)