Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/userGuide/components/presentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ For more information, please refer to this [section]({{baseUrl}}/userGuide/using

<br>

## Card Component

The `<Card>` component is used to present content in a styled card layout, often within a `<CardStack>` for grid-based alignment.

You can now assign a custom `id` to a `<Card>` element. This helps:
- Link directly to the card via anchor tags (`#card-id`)
- Target cards using custom CSS or JavaScript

### Example

```html
<Card id="overview-card">
<template #header>Overview</template>
This is the content of a card with a custom ID.
</Card>


# Relevant Tips & Tricks

<panel header="Indent components">
Expand Down
21 changes: 21 additions & 0 deletions docs/userGuide/usingHtmlJavaScriptCss.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,26 @@ const myChart = new Chart(ctx, {
</variable>
</include>

## 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') }}
9 changes: 9 additions & 0 deletions packages/cli/test/functional/test_site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,12 @@ and **this**.
<code>{{ code elements should automatically be assigned v-pre }}</code>

{% endraw %}

<hr>

<header><h2>Card ID Test</h2></header>

<Card id="test-card-id">
<template #header>Test Card Header</template>
This card has a custom <code>id="test-card-id"</code> and should be accessible via <a href="#test-card-id">this anchor link</a>.
</Card>
10 changes: 9 additions & 1 deletion packages/vue-components/src/cardstack/Card.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<div v-show="!computeDisabled" :class="`col-md-${computedBlock}`">
<div
v-show="!computeDisabled"
:class="`col-md-${computedBlock}`"
:id="id"
>
<div class="card">
<div class="card-body article-container" :style="computedWidth">
<div
Expand Down Expand Up @@ -49,6 +53,10 @@ export default {
type: String,
default: '',
},
id: {
type: String,
default: '',
},
},
data() {
return {
Expand Down