-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-organize KCard styles to simplify and improve content tolerance #838
Merged
MisRob
merged 3 commits into
learningequality:develop
from
MisRob:content-tolerance-card
Dec 4, 2024
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Contains pages of rather private character that serve for manual preview of components. Accessible on url /qa/... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,277 @@ | ||
<template> | ||
|
||
<div style="padding: 80px"> | ||
<h1 id="link-target"> | ||
Cards QA page | ||
</h1> | ||
<p>Also preview live examples on <code>KCardGrid</code> and <code>KCard</code> documentation pages.</p> | ||
|
||
<section> | ||
<h2>Horizontal cards with large amount of content</h2> | ||
|
||
<KCardGrid layout="1-2-3"> | ||
<KCard | ||
v-for="{ display, align } in horizontalThumbnailCombinations" | ||
:key="`${display}-${align}`" | ||
:headingLevel="3" | ||
orientation="horizontal" | ||
:thumbnailDisplay="display" | ||
:thumbnailAlign="align" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
:title="`With thumbnail display: '${display}' and thumbnail align: '${align}'`" | ||
> | ||
<template #aboveTitle> | ||
<KLabeledIcon icon="readSolid" label="Read" /> | ||
</template> | ||
<template #belowTitle> | ||
<KTextTruncator | ||
text="Discover how hummingbirds play a big role in nature despite their small size. Find out more about their beauty, how they help plants grow, and where they live." | ||
:maxLines="3" | ||
/> | ||
</template> | ||
<template #footer> | ||
<div class="footer-wrapper"> | ||
<div class="pills" :style="{ 'color': $themeTokens.annotation }"> | ||
<span | ||
:style="{ 'background-color': $themePalette.grey.v_100 }" | ||
> | ||
<KIcon icon="readSolid" :style="{ fontSize: '13px', position: 'relative', top: '3px' }" /> | ||
Read | ||
</span> | ||
<span :style="{ 'background-color': $themePalette.grey.v_100 }"> | ||
Short Activity | ||
</span> | ||
</div> | ||
</div> | ||
<div :style="{ marginTop: '8px' }"> | ||
<KFixedGrid :numCols="4"> | ||
<KFixedGridItem :span="3" :style="{ paddingTop: '8px' }"> | ||
<KLinearLoader | ||
type="determinate" | ||
:progress="20" | ||
/> | ||
</KFixedGridItem> | ||
<KFixedGridItem :span="1" alignment="right"> | ||
<KIcon icon="schedule" :style="{ fontSize: '18px' }" /> | ||
</KFixedGridItem> | ||
</KFixedGrid> | ||
</div> | ||
</template> | ||
</KCard> | ||
</KCardGrid> | ||
</section> | ||
|
||
<section> | ||
<h2>Horizontal cards with small amount of content</h2> | ||
<KCardGrid layout="1-2-3"> | ||
<KCard | ||
v-for="{ display, align } in horizontalThumbnailCombinations" | ||
:key="`${display}-${align}`" | ||
:headingLevel="3" | ||
:titleMaxLines="1" | ||
orientation="horizontal" | ||
:thumbnailDisplay="display" | ||
:thumbnailAlign="align" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
:title="`With thumbnail display: '${display}' and thumbnail align: '${align}'`" | ||
> | ||
<template #belowTitle> | ||
<KTextTruncator | ||
text="Discover how hummingbirds play a big role in nature" | ||
:maxLines="1" | ||
/> | ||
</template> | ||
</KCard> | ||
</KCardGrid> | ||
</section> | ||
|
||
<section> | ||
<h2>Vertical cards with large amount of content</h2> | ||
<KCardGrid layout="1-2-3"> | ||
<KCard | ||
v-for="{ display } in verticalThumbnailCombinations" | ||
:key="`${display}`" | ||
:headingLevel="3" | ||
orientation="vertical" | ||
:thumbnailDisplay="display" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
:title="`With thumbnail display: '${display}'`" | ||
> | ||
<template #aboveTitle> | ||
<KLabeledIcon icon="readSolid" label="Read" /> | ||
</template> | ||
<template #belowTitle> | ||
<KTextTruncator | ||
text="Discover how hummingbirds play a big role in nature despite their small size. Find out more about their beauty, how they help plants grow, and where they live." | ||
:maxLines="3" | ||
/> | ||
</template> | ||
<template #footer> | ||
<div class="footer-wrapper"> | ||
<div class="pills" :style="{ 'color': $themeTokens.annotation }"> | ||
<span | ||
:style="{ 'background-color': $themePalette.grey.v_100 }" | ||
> | ||
<KIcon icon="readSolid" :style="{ fontSize: '13px', position: 'relative', top: '3px' }" /> | ||
Read | ||
</span> | ||
<span :style="{ 'background-color': $themePalette.grey.v_100 }"> | ||
Short Activity | ||
</span> | ||
</div> | ||
</div> | ||
<div :style="{ marginTop: '8px' }"> | ||
<KFixedGrid :numCols="4"> | ||
<KFixedGridItem :span="3" :style="{ paddingTop: '8px' }"> | ||
<KLinearLoader | ||
type="determinate" | ||
:progress="20" | ||
/> | ||
</KFixedGridItem> | ||
<KFixedGridItem :span="1" alignment="right"> | ||
<KIcon icon="schedule" :style="{ fontSize: '18px' }" /> | ||
</KFixedGridItem> | ||
</KFixedGrid> | ||
</div> | ||
</template> | ||
</KCard> | ||
</KCardGrid> | ||
</section> | ||
|
||
<section> | ||
<h2>Vertical cards with small amount of content</h2> | ||
<KCardGrid layout="1-2-3"> | ||
<KCard | ||
v-for="{ display } in verticalThumbnailCombinations" | ||
:key="`${display}`" | ||
:headingLevel="3" | ||
orientation="vertical" | ||
:thumbnailDisplay="display" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
:title="`With thumbnail display: '${display}'`" | ||
> | ||
<template #belowTitle> | ||
<KTextTruncator | ||
text="Discover how hummingbirds play a big role in nature" | ||
:maxLines="1" | ||
/> | ||
</template> | ||
</KCard> | ||
</KCardGrid> | ||
</section> | ||
|
||
<section> | ||
<h2>Cards when links</h2> | ||
<KCardGrid layout="1-2-3"> | ||
<KCard | ||
:to="{ path: '#link-target' }" | ||
:headingLevel="3" | ||
orientation="horizontal" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
title="First card" | ||
/> | ||
<KCard | ||
:to="{ path: '#link-target' }" | ||
:headingLevel="3" | ||
orientation="horizontal" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
title="Second card" | ||
/> | ||
</KCardGrid> | ||
</section> | ||
|
||
<section> | ||
<h2>Cards when not links</h2> | ||
<KCardGrid layout="1-2-3"> | ||
<KCard | ||
:headingLevel="3" | ||
orientation="horizontal" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
title="First card" | ||
/> | ||
<KCard | ||
:headingLevel="3" | ||
orientation="horizontal" | ||
:thumbnailSrc="require('../../assets/hummingbird-large-cc-by-sa-4.jpg')" | ||
title="Second card" | ||
/> | ||
</KCardGrid> | ||
</section> | ||
</div> | ||
|
||
</template> | ||
|
||
|
||
<script> | ||
|
||
export default { | ||
name: 'QaCards', | ||
data() { | ||
return { | ||
horizontalThumbnailCombinations: [ | ||
{ | ||
display: 'none', | ||
align: 'left', | ||
}, | ||
{ | ||
display: 'small', | ||
align: 'left', | ||
}, | ||
{ | ||
display: 'large', | ||
align: 'left', | ||
}, | ||
{ | ||
display: 'none', | ||
align: 'right', | ||
}, | ||
{ | ||
display: 'small', | ||
align: 'right', | ||
}, | ||
{ | ||
display: 'large', | ||
align: 'right', | ||
}, | ||
], | ||
verticalThumbnailCombinations: [ | ||
{ | ||
display: 'none', | ||
}, | ||
{ | ||
display: 'small', | ||
}, | ||
{ | ||
display: 'large', | ||
}, | ||
], | ||
}; | ||
}, | ||
}; | ||
|
||
</script> | ||
|
||
|
||
<style lang="scss" scoped> | ||
|
||
section { | ||
margin-top: 84px; | ||
} | ||
|
||
.footer-wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.pills { | ||
margin-left: -4px; | ||
|
||
span { | ||
display: inline-block; | ||
padding: 4px 8px; | ||
margin: 4px; | ||
border-radius: 4px; | ||
} | ||
} | ||
|
||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO @MisRob: move to
docs/pages/playground/cards.vue
as per @AlexVelezLl feedback