mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-21 15:48:05 +00:00
updates feature-card to use non-fixed heights by leveraging an aspect ratio mixin
This commit is contained in:
parent
55d38d3bbf
commit
0673b723dc
@ -98,3 +98,26 @@
|
|||||||
|
|
||||||
#{$property}: $value;
|
#{$property}: $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Maintains the aspect ratio for a wrapped element
|
||||||
|
/// @param {Number} $width number value for the container's width ratio
|
||||||
|
/// @param {Number} $height number value for the container's with ratio
|
||||||
|
@mixin aspect-ratio($width, $height) {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
padding-top: ($height / $width) * 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
> * {
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
.feature-card {
|
.feature-card {
|
||||||
height: 160px;
|
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
margin: 30px 0;
|
margin: 30px 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@ -16,3 +15,8 @@
|
|||||||
color: set-color(black, dune);
|
color: set-color(black, dune);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Wrap cards in containers with 1:1 ar
|
||||||
|
.feature-container {
|
||||||
|
@include aspect-ratio(1, 1);
|
||||||
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{#each model as |featureCard|}}
|
{{#each model as |featureCard|}}
|
||||||
<div class="col-sm-3">
|
<div class="col-md-3">
|
||||||
|
<div class="feature-container">
|
||||||
<article class="feature-card">
|
<article class="feature-card">
|
||||||
{{#link-to featureCard.route}}
|
{{#link-to featureCard.route}}
|
||||||
<span class="feature-card-icon" title={{featureCard.title}}></span>
|
<span class="feature-card-icon" title={{featureCard.title}}></span>
|
||||||
@ -11,5 +14,8 @@
|
|||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user