/********************** * Common **********************/ .thumbnail (@width: 150px, @height: 150px, @object-fit: contain) { text-align: center; img { width: @width; height: @height; object-fit: @object-fit; } } .excerpt (@lineHeight: 1.2em, @lineCount: 1, @bgColor: white){ overflow: hidden; position: relative; line-height: @lineHeight; max-height: calc(@lineHeight * @lineCount); text-align: justify; margin-right: -1em; padding-right: 1em; &:before { content: '...'; position: absolute; right: 0; bottom: 0; } &:after { content: ''; position: absolute; right: 0; width: 1em; height: 1em; margin-top: 0.2em; background: @bgColor; } } /********************** * Card **********************/ .card { position: relative; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; background-color: #fff; border: 1px solid rgba(0,0,0,.125); border-radius: .25rem; .card-header { padding: .75rem 1.25rem; margin-bottom: 0; background-color: #f7f7f9; border-bottom: 1px solid rgba(0,0,0,.125); &:first-child { border-radius: calc(.25rem - 1px) calc(.25rem - 1px) 0 0; } } .card-img-top { padding-top: 2rem; .thumbnail; } .card-block { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; padding: 2rem; .card-title { margin-bottom: .75rem; } .card-text { .excerpt(1.2em, 3); } } .card-footer { padding: .75rem 1.25rem; background-color: #f7f7f9; border-top: 1px solid rgba(0,0,0,.125); &:last-child { border-radius: 0 0 calc(.25rem - 1px) calc(.25rem - 1px); } } }