react-toolbox/components/card/style.scss

146 lines
2.2 KiB
SCSS
Raw Normal View History

@import "../base";
@import "./config";
2015-10-04 04:10:13 +03:00
.card {
// Box Model
2015-10-05 15:54:29 +03:00
display: flex;
flex-direction: column;
border-radius: 2px;
overflow: hidden;
2015-11-22 09:01:49 +03:00
width: 100%;
// Fonts
font-size: $card-font-size;
// Colors
background: $card-background-color;
// Elevation
@include shadow-2dp();
// Raised Elevation as per spec
&.raised {
@include shadow-8dp();
}
}
.cardMedia {
position: relative;
background-repeat: no-repeat;
2015-10-05 15:54:29 +03:00
background-size: cover;
background-position: center center;
height: 0;
2015-11-22 09:01:49 +03:00
&.wide, &.square {
width: 100%;
2015-11-22 09:01:49 +03:00
.content > iframe, .content > video, .content > img {
max-width: 100%;
}
}
&.wide {
padding-top: 56.25%;
}
&.square {
padding-top: 100%;
2015-10-05 15:54:29 +03:00
}
.content {
// Positioning
2015-10-05 15:54:29 +03:00
position: absolute;
top: 0;
left: 0;
// Box Model
display: flex;
flex-direction: column;
2015-11-22 04:43:18 +03:00
justify-content: flex-end;
2015-10-05 15:54:29 +03:00
width: 100%;
height: 100%;
2015-11-22 09:01:49 +03:00
overflow: hidden;
2015-10-05 15:54:29 +03:00
}
2015-11-22 04:43:18 +03:00
.contentOverlay {
.cardTitle, .cardActions, .cardText {
background-color: $card-text-overlay;
}
}
2015-10-05 15:54:29 +03:00
}
2015-10-04 04:10:13 +03:00
.cardTitle {
display: flex;
align-items: center;
2015-10-04 04:10:13 +03:00
.avatar {
margin-right: 13px;
2015-10-04 04:10:13 +03:00
}
.subtitle {
color: $color-text-secondary;
}
2015-10-04 04:10:13 +03:00
&.large {
padding: $card-padding-lg $card-padding ($card-padding - 2px);
.title {
@include typo-headline();
line-height: 1.25;
}
2015-10-04 04:10:13 +03:00
}
&.small {
padding: $card-padding;
.title {
@include typo-body-2(false, true);
line-height: 1.4;
}
.subtitle {
font-weight: 500;
line-height: 1.4;
}
2015-10-04 04:10:13 +03:00
}
2015-11-22 04:43:18 +03:00
.cardMedia & {
.title, .subtitle {
color: $card-color-white;
}
}
2015-10-05 15:54:29 +03:00
}
2015-10-04 04:10:13 +03:00
.cardTitle, .cardText {
padding: ($card-padding - 2px) $card-padding;
2015-10-05 17:18:02 +03:00
&:last-child {
padding-bottom: $card-padding-lg;
2015-10-04 04:10:13 +03:00
}
2015-10-05 17:18:02 +03:00
& + .cardText {
padding-top: 0;
2015-10-04 04:10:13 +03:00
}
}
2015-10-05 17:18:02 +03:00
.cardActions {
display: flex;
align-items: center;
justify-content: flex-start;
padding: $card-padding-sm $card-padding-sm;
2015-11-22 09:01:49 +03:00
button {
min-width: 0;
margin: 0 $card-padding-sm/2;
2015-11-22 04:43:18 +03:00
padding: 0 $card-padding-sm;
&:first-child {
2015-11-22 04:43:18 +03:00
margin-left: 0;
2015-10-05 17:18:02 +03:00
}
&:last-child {
2015-11-22 04:43:18 +03:00
margin-right: 0;
}
}
2015-10-05 15:54:29 +03:00
}