Skip to content

Commit e1fccff

Browse files
authored
feat(card): basic variant
New basic variant which does not have a border and also allows support for full color background
1 parent bcd29ea commit e1fccff

File tree

3 files changed

+123
-10
lines changed

3 files changed

+123
-10
lines changed

src/definitions/views/card.less

Lines changed: 114 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,28 @@
358358
}
359359
}
360360

361+
& when (@variationCardBasic) {
362+
/*--------------
363+
Basic
364+
---------------*/
365+
.ui.cards:not(.raised) > .basic.card:not(.raised),
366+
.ui.ui.ui.basic.cards:not(.raised) > .card:not(.raised),
367+
.ui.ui.ui.basic.card:not(.raised) {
368+
box-shadow: none;
369+
& > .buttons,
370+
> .button {
371+
margin: 0;
372+
width: 100%;
373+
}
374+
}
375+
& when (@variationCardLink) {
376+
.ui.ui.ui.ui.ui.basic.card:not(.raised):hover,
377+
.ui.ui.ui.ui.ui.basic.cards:not(.raised) .card:not(.raised):hover {
378+
box-shadow: none;
379+
}
380+
}
381+
}
382+
361383
/*--------------
362384
Dimmer
363385
---------------*/
@@ -561,6 +583,7 @@
561583
Raised
562584
--------------------*/
563585

586+
.ui.cards > .raised.card,
564587
.ui.raised.cards > .card,
565588
.ui.raised.card {
566589
box-shadow: @raisedShadow;
@@ -573,6 +596,24 @@
573596
box-shadow: @raisedShadowHover;
574597
}
575598
}
599+
& when (@variationCardBasic) {
600+
.ui.basic.cards > .raised.card,
601+
.ui.basic.raised.cards > .card,
602+
.ui.raised.cards > .basic.card,
603+
.ui.basic.raised.card {
604+
box-shadow: @basicRaisedShadow;
605+
}
606+
& when (@variationCardLink) {
607+
.ui.basic.raised.cards a.card:hover,
608+
.ui.link.cards .basic.raised.card:hover,
609+
.ui.link.basic.cards .raised.card:hover,
610+
.ui.link.basic.raised.cards .card:hover,
611+
a.ui.basic.raised.card:hover,
612+
.ui.link.basic.raised.card:hover {
613+
box-shadow: @basicRaisedShadowHover;
614+
}
615+
}
616+
}
576617
}
577618

578619
& when (@variationCardCentered) {
@@ -636,6 +677,7 @@
636677
@h: @colors[@@color][hover];
637678
@l: @colors[@@color][light];
638679
@lh: @colors[@@color][lightHover];
680+
@isVeryDark: @colors[@@color][isVeryDark];
639681

640682
.ui.@{color}.cards > .card,
641683
.ui.cards > .@{color}.card,
@@ -645,14 +687,49 @@
645687
0 @coloredShadowDistance 0 0 @c,
646688
@shadowBoxShadow
647689
;
648-
&:hover {
649-
box-shadow:
650-
@borderShadow,
651-
0 @coloredShadowDistance 0 0 @h,
652-
@shadowHoverBoxShadow
690+
}
691+
& when (@variationCardLink) {
692+
.ui.cards a.@{color}.card:hover,
693+
.ui.@{color}.cards a.card:hover,
694+
.ui.link.@{color}.cards .card:not(.icon):hover,
695+
.ui.link.cards .@{color}.card:not(.icon):hover,
696+
a.ui.@{color}.card:hover,
697+
.ui.link.@{color}.card:hover {
698+
box-shadow:
699+
@borderShadow,
700+
0 @coloredShadowDistance 0 0 @h,
701+
@shadowHoverBoxShadow
653702
;
654703
}
655704
}
705+
& when (@variationCardBasic) {
706+
.ui.cards > .basic.@{color}.card,
707+
.ui.basic.@{color}.cards > .card,
708+
.ui.basic.cards > .@{color}.card,
709+
.ui.basic.@{color}.card {
710+
background: @l;
711+
& when (@isVeryDark) {
712+
& .header,
713+
.content,
714+
.meta,
715+
.description {
716+
color: @white;
717+
}
718+
}
719+
}
720+
& when (@variationCardLink) {
721+
.ui.basic.cards a.@{color}.card:hover,
722+
.ui.cards a.basic.@{color}.card:hover,
723+
.ui.basic.@{color}.cards a.card:hover,
724+
.ui.link.cards .basic.@{color}.card:not(.icon):hover,
725+
.ui.link.basic.@{color}.cards .card:not(.icon):hover,
726+
.ui.link.basic.cards .@{color}.card:not(.icon):hover,
727+
a.ui.basic.@{color}.card:hover,
728+
.ui.link.basic.@{color}.card:hover {
729+
background: @lh;
730+
}
731+
}
732+
}
656733
& when (@variationCardInverted) {
657734
.ui.inverted.@{color}.cards > .card,
658735
.ui.inverted.cards > .@{color}.card,
@@ -662,14 +739,41 @@
662739
0 @coloredShadowDistance 0 0 @l,
663740
0 0 0 @borderWidth @solidWhiteBorderColor
664741
;
665-
&:hover {
666-
box-shadow:
667-
0 @shadowDistance 3px 0 @solidWhiteBorderColor,
668-
0 @coloredShadowDistance 0 0 @lh,
669-
0 0 0 @borderWidth @solidWhiteBorderColor
742+
}
743+
& when (@variationCardLink) {
744+
.ui.inverted.cards a.@{color}.card:hover,
745+
.ui.inverted.@{color}.cards a.card:hover,
746+
.ui.link.inverted.@{color}.cards .card:not(.icon):hover,
747+
.ui.link.inverted.cards .@{color}.card:not(.icon):hover,
748+
a.ui.inverted.@{color}.card:hover,
749+
.ui.link.inverted.@{color}.card:hover {
750+
box-shadow:
751+
0 @shadowDistance 3px 0 @solidWhiteBorderColor,
752+
0 @coloredShadowDistance 0 0 @lh,
753+
0 0 0 @borderWidth @solidWhiteBorderColor
670754
;
671755
}
672756
}
757+
& when (@variationCardBasic) {
758+
.ui.inverted.cards > .basic.@{color}.card,
759+
.ui.basic.inverted.@{color}.cards > .card,
760+
.ui.basic.inverted.cards > .@{color}.card,
761+
.ui.basic.inverted.@{color}.card {
762+
background: @c;
763+
}
764+
& when (@variationCardLink) {
765+
.ui.inverted.cards a.basic.@{color}.card:hover,
766+
.ui.basic.inverted.cards a.@{color}.card:hover,
767+
.ui.basic.inverted.@{color}.cards a.card:hover,
768+
.ui.link.inverted.cards .basic.@{color}.card:not(.icon):hover,
769+
.ui.link.basic.inverted.@{color}.cards .card:not(.icon):hover,
770+
.ui.link.basic.inverted.cards .@{color}.card:not(.icon):hover,
771+
a.ui.basic.inverted.@{color}.card:hover,
772+
.ui.link.basic.inverted.@{color}.card:hover {
773+
background: @h;
774+
}
775+
}
776+
}
673777
}
674778
})
675779
}

src/themes/default/globals/variation.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@
403403

404404
/* Card */
405405
@variationCardInverted: true;
406+
@variationCardBasic: true;
406407
@variationCardDisabled: true;
407408
@variationCardLoading: true;
408409
@variationCardHorizontal: true;

src/themes/default/views/card.variables

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@
188188
@floatingShadowHover
189189
;
190190

191+
/* Basic Raised */
192+
@basicRaisedShadow:
193+
@floatingShadow
194+
;
195+
@basicRaisedShadowHover:
196+
@floatingShadowHover
197+
;
198+
191199
/* Card Count */
192200
@wideCardSpacing: 1em;
193201
@cardSpacing: 0.75em;

0 commit comments

Comments
 (0)