option.scss 4.12 KB
.wpzinc-option {
	display: grid;
	grid-template-areas: "left right";
	grid-template-columns: $wpzinc-option-label-width auto;
	grid-column-gap: 5px;
	grid-row-gap: 5px;
	justify-items: start;
	text-align: left;
	padding: 10px 15px;
	border-width: 1px 0; 
	border-style: solid; 
	border-top: none;
	border-bottom-color: #dfdfdf; 
	background-color: #f5f5f5;
	-webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;

    &.sidebar {
    	grid-template-columns: ( $wpzinc-option-label-width - 20 ) auto;
    }

	/**
	 * Alternate background
	 */
	&:nth-child(odd) {
		background-color: #fcfcfc; 
	}

	/**
	 * Ignore Alternate Background
	 */
	&.ignore-nth-child:nth-child(odd) {
		background-color: #f5f5f5;
	}

	/**
	 * No Bottom Border
	 */
	&.no-bottom-border {
		border-bottom: none;
	}

    /**
     * Highlighted
     */
	&.highlight {
		background-color: #fcf8e3 !important;

		div.full,
		div.right {
			h4 {
				margin: 5px 0 10px 0;
				font-size: 14px;
				line-height: 22px;
			}

			p {
				margin: 0 0 10px 0;
				font-size: 14px;
				line-height: 22px;
			}
						
			a.button {
				margin: 5px 0 0 0;
			}
		}
	}

	/**
	 * No Background or Border
	 */
	&.no-styling {
		background: none;
		border: none;
		padding: 0 0 10px 0;
	}

	/**
	 * Hidden
	 */
	&.hidden {
		display: none;
	}

	/**
	 * Two column layout
	 */
	div.left {
		width: 100%;
		grid-area: left;
		-webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;

		/**
		* Apply line height to all items except inputs
		*/
		*:not(input) {
			line-height: 27px;
		}

		a {
			text-decoration: none;
		}
	}
	div.right {
		width: 100%;
		grid-area: right;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;

        /**
		* Apply line heights
		*/
		line-height: 27px;
		strong {
			line-height: 27px;
		}

		/**
		 * Don't apply line heights to <strong> inside descriptions
		 */
		p.description {
			strong {
				line-height: 1;
			}
		}

		/**
		 * Don't apply line heights to <strong> inside selectize dropdowns
		 */
		div.selectize-dropdown-content {
			strong {
				line-height: normal;
			}
		}

		/**
		 * Success / Error Colors
		 */
		.success {
			color: green;
		}
		.error {
			color: red;
		}
	}
	div.full {
		width: 100%;
		grid-column: 1 / span 2;

		line-height: 30px;
	}
	p.description {
		grid-column: 1 / span 2;
	}

	/**
	* Elements
	*/
	label {
		font-weight: 600;
		white-space: normal;

		&.selectit {
			font-weight: 400;
		}
	}
	select.right,
	input.right {
		float: right;
	}

	input, select {
		margin: 0;
	}
	select {
		border: 1px solid #7e8993;
		vertical-align: baseline;
	}

	textarea {
		&.no-wrap {
			white-space: pre;
	  		overflow-wrap: normal;
	  		overflow-x: scroll;
	  	}
	}

	/**
	* ContentEditable
	* - Style the same as a textarea
	*/
	.content-editable {
		min-height: 70px;
		box-sizing: border-box;
		padding: 2px 6px;
    	line-height: 1.42857143;
		font-size: 14px;
		box-shadow: 0 0 0 transparent;
	    border-radius: 4px;
	    border: 1px solid #8c8f94;
	    background-color: #fff;
	    color: #2c3338;

	    &:focus {
	    	border-color: #2271b1;
		    box-shadow: 0 0 0 1px #2271b1;
		    outline: 2px solid transparent;
	    }

		&.no-wrap {
			white-space: pre;
	  		overflow-wrap: normal;
	  		overflow-x: scroll;
	  	}
	}

	/**
	* Horizontal Selection
	*/
	&:nth-child(odd) {
		.wpzinc-horizontal-selection {
			label {
				background-color: #f5f5f5;
			}
		}
	}

	/**
	* Details
	*/
	details {
		summary {
			h3 {
				margin: 0;
			}
		}
	}

	/**
	* Checkbox Lists
	*/
	.checklist {
		margin: 0;
		padding: 0;
		list-style: none;

		li {
			line-height: 1;

			label {
				font-weight: 400;
			}
		}
	}
	
	/**
	* Tables
	*/
	table.widefat {
		clear: none;

		tbody {
			/**
			 * Hide the first row's delete button on repeater rows
			 */
			tr:first-child, tr.hide-delete-button {
				td {
					a.delete-table-row {
						display: none;
					}
				}
			}

			/**
			 * Label Vertical Alignment
			 */
			tr {
				td {
					label, strong {
						line-height: 30px;
					}
				}
			}
		}

		.vertical-align-middle {
			vertical-align: middle;
		}
	}
}