Socialify

Folder ..

Viewing _pm-table.scss
119 lines (103 loc) • 1.8 KB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * tables
 */
.pm-simple-table {
	@extend .border-collapse;
	@extend .noborder;
	@extend .w100;

	caption {
		transform: scale(0);
	}

	td,
	th {
		padding: em(9);
		border-bottom: 1px solid var(--bordercolor-input, $pm-global-border);
	}

	th:not(#{&}-row-th) {
		@extend .uppercase;
		@extend .alignleft;

		&.aligncenter {
			@extend .aligncenter;
		}

		&.alignright {
			@extend .alignright;
		}
		@include respond-to($breakpoint-small) {
			&.onmobile-aligncenter {
				@extend .onmobile-aligncenter;
			}
		}
	}

	// no style for this case
	&-row-th {
		font-weight: normal;
	}

	/* alternate bg for rows */
	&--alternate-bg-row tbody tr:nth-child(odd){
		background-color: var(--bgcolor-input, $pm-global-light);
	}

	&--isHoverable tbody tr {
		@media (hover: hover) {
			&:hover,
			&:focus-within {
				background-color: var(--bgcolor-input, $pm-global-light);
			}
		}
	}

	tr#{&}-stickyRow {
		td,
		th {
			position: sticky;
			top: 0;
			background: var(--bgcolor-main-area, $white);
			z-index: 1;

			&::after {
				content: '';
				position: absolute;
				top: 100%;
				left: 0;
				right: 0;
				z-index: -1;
				height: 1rem;
				background: linear-gradient(to bottom, rgba(black, .1) 0%, transparent 100%);
				pointer-events: none;
				transition: opacity .125s ease-out;
			}
		}
	}

	tr#{&}-stickyRow#{&}-stickyRow--isOnTop {
		td,
		th {
			&::after {
				opacity: 0;
			}
		}
	}

	/* bordered-table */
	&--bordered {
		&,
		th,
		td {
			border: 1px solid var(--bordercolor-input, $pm-global-border);
		}
	}

	&--has-actions {
		td,
		th {
			&:last-child {
				text-align: right;
			}
		}
	}

	/* simple dirty fix */
	a svg {
		@extend .relative;
		top: -0.15em;
	}
}


/*
 * specifics case
 */
.pm-plans-table-row--highlighted {
	background-color: var(--bgcolor-input, $pm-global-light);
}