diff --git a/docs/userGuide/components/presentation.md b/docs/userGuide/components/presentation.md index 026f480fa5..69ae4ad1da 100644 --- a/docs/userGuide/components/presentation.md +++ b/docs/userGuide/components/presentation.md @@ -45,6 +45,23 @@ For more information, please refer to this [section]({{baseUrl}}/userGuide/using
+## Card Component + +The `` component is used to present content in a styled card layout, often within a `` for grid-based alignment. + +You can now assign a custom `id` to a `` element. This helps: +- Link directly to the card via anchor tags (`#card-id`) +- Target cards using custom CSS or JavaScript + +### Example + +```html + + + This is the content of a card with a custom ID. + + + # Relevant Tips & Tricks diff --git a/docs/userGuide/usingHtmlJavaScriptCss.md b/docs/userGuide/usingHtmlJavaScriptCss.md index abf13c316c..03d933abbb 100644 --- a/docs/userGuide/usingHtmlJavaScriptCss.md +++ b/docs/userGuide/usingHtmlJavaScriptCss.md @@ -148,5 +148,26 @@ const myChart = new Chart(ctx, { +## Using Custom CSS in MarkBind + +You can apply your own custom CSS styles to customize how your site looks. + +There are two common ways to add custom CSS in MarkBind: + +### 1. Add a site-wide custom stylesheet + +To apply styles across your whole site, create a file called `styles.css` (or similar), and add it to your `site.json` under `head`: + +```json +"head": [ + { + "tagName": "link", + "attributes": { + "rel": "stylesheet", + "href": "/styles.css" + } + } +] + {% from "njk/common.njk" import previous_next %} {{ previous_next('components/advanced', 'tweakingThePageStructure') }} diff --git a/packages/cli/test/functional/test_site/index.md b/packages/cli/test/functional/test_site/index.md index 0c3eff0c2f..c7bfece319 100644 --- a/packages/cli/test/functional/test_site/index.md +++ b/packages/cli/test/functional/test_site/index.md @@ -356,3 +356,12 @@ and **this**. {{ code elements should automatically be assigned v-pre }} {% endraw %} + +
+ +

Card ID Test

+ + + + This card has a custom id="test-card-id" and should be accessible via this anchor link. + diff --git a/packages/vue-components/src/cardstack/Card.vue b/packages/vue-components/src/cardstack/Card.vue index 79f2229411..d3d55a1f9c 100644 --- a/packages/vue-components/src/cardstack/Card.vue +++ b/packages/vue-components/src/cardstack/Card.vue @@ -1,5 +1,9 @@