Fix PHP, CSS AND JS coding standards

This commit is contained in:
Ismail El Korchi 2020-04-05 21:49:27 +01:00
parent 2351bef6ca
commit f94fc1e59b
42 changed files with 357 additions and 213 deletions

View file

@ -2,7 +2,9 @@
* Checkout
*/
@media screen and (min-width: 768px) {
.col2-set {
.form-row-first {
float: left;
margin-right: $columns__margin;
@ -15,6 +17,7 @@
.form-row-first,
.form-row-last {
@include column-width(2);
}
}

View file

@ -5,6 +5,7 @@
position: relative;
margin: 0;
padding: 0;
@include clearfix;
.cart-contents {
@ -31,12 +32,12 @@
line-height: 1.618;
font-size: 1em;
width: 5.3em;
font-family: 'star';
font-family: star;
font-weight: 400;
&:before {
&::before {
content: "\53\53\53\53\53";
opacity: .25;
opacity: 0.25;
float: left;
top: 0;
left: 0;
@ -52,7 +53,7 @@
padding-top: 1.5em;
}
span:before {
span::before {
content: "\53\53\53\53\53";
top: 0;
position: absolute;
@ -62,6 +63,7 @@
}
p.stars {
a {
position: relative;
height: 1em;
@ -72,7 +74,8 @@ p.stars {
margin-right: 1px;
font-weight: 400;
&:before {
&::before {
display: block;
position: absolute;
top: 0;
@ -80,25 +83,28 @@ p.stars {
width: 1em;
height: 1em;
line-height: 1;
font-family: "star";
font-family: star;
content: "\53";
color: $color__text-main;
text-indent: 0;
opacity: .25;
opacity: 0.25;
}
&:hover {
~ a:before {
~ a::before {
content: "\53";
color: $color__text-main;
opacity: .25;
opacity: 0.25;
}
}
}
&:hover {
a {
&:before {
&::before {
content: "\53";
color: $color__link;
opacity: 1;
@ -107,22 +113,25 @@ p.stars {
}
&.selected {
a.active {
&:before {
&::before {
content: "\53";
color: $color__link;
opacity: 1;
}
~ a:before {
~ a::before {
content: "\53";
color: $color__text-main;
opacity: .25;
opacity: 0.25;
}
}
a:not(.active) {
&:before {
&::before {
content: "\53";
color: $color__link;
opacity: 1;
@ -135,6 +144,7 @@ p.stars {
* Tabs
*/
.woocommerce-tabs {
ul.tabs {
list-style: none;
margin: 0;
@ -154,6 +164,7 @@ p.stars {
}
.panel {
h2:first-of-type {
margin-bottom: 1em;
}
@ -187,13 +198,16 @@ p.stars {
* Forms
*/
.form-row {
&.woocommerce-validated {
input.input-text {
box-shadow: inset 2px 0 0 $woocommerce__color-success;
}
}
&.woocommerce-invalid {
input.input-text {
box-shadow: inset 2px 0 0 $woocommerce__color-error;
}
@ -201,7 +215,7 @@ p.stars {
}
.required {
color: red;
color: #f00;
}
/**
@ -212,6 +226,7 @@ p.stars {
.woocommerce-error,
.woocommerce-noreviews,
p.no-comments {
@include clearfix;
background-color: $woocommerce__color-success;
clear: both;
@ -239,10 +254,12 @@ p.no-comments {
}
@media screen and (min-width: 48em) {
/**
* Header cart
*/
.site-header-cart {
.widget_shopping_cart {
position: absolute;
top: 100%;
@ -255,6 +272,7 @@ p.no-comments {
&:hover,
&.focus {
.widget_shopping_cart {
left: 0;
display: block;

View file

@ -2,6 +2,7 @@
* Products
*/
ul.products {
@include clearfix;
margin: 0;
padding: 0;
@ -26,8 +27,11 @@ ul.products {
}
@media screen and (min-width: 48em) {
ul.products {
li.product {
@include column-width(3);
float: left;
margin-right: $columns__margin;
@ -43,7 +47,9 @@ ul.products {
}
.columns-1 {
ul.products {
li.product {
float: none;
width: 100%;
@ -52,9 +58,13 @@ ul.products {
}
@for $i from 2 through 6 {
.columns-#{$i} {
ul.products {
li.product {
@include column-width( $i );
}
}

View file

@ -2,7 +2,9 @@
* Single Product
*/
.single-product {
div.product {
@include clearfix;
position: relative;
@ -22,6 +24,7 @@
}
.flex-control-thumbs {
@include clearfix;
margin: 0;
padding: 0;
@ -32,7 +35,7 @@
float: left;
img {
opacity: .5;
opacity: 0.5;
&.flex-active {
opacity: 1;
@ -40,6 +43,7 @@
}
&:hover {
img {
opacity: 1;
}
@ -48,9 +52,13 @@
}
@for $i from 2 through 5 {
&.woocommerce-product-gallery--columns-#{$i} {
.flex-control-thumbs {
li {
@include column-width($i);
&:nth-child(#{$i}n) {
@ -69,7 +77,8 @@
}
.stock {
&:empty:before {
&:empty::before {
display: none;
}

View file

@ -2,45 +2,51 @@
* Shop tables
*/
table.shop_table_responsive {
thead {
display: none;
}
tbody {
th {
display: none;
}
}
tr {
td {
display: block;
text-align: right;
clear: both;
&:before {
content: attr(data-title) ': ';
&::before {
content: attr(data-title) ": ";
float: left;
}
&.product-remove {
a {
text-align: left;
}
&:before {
&::before {
display: none;
}
}
&.actions,
&.download-actions {
&:before {
&::before {
display: none;
}
}
&.download-actions {
.button {
display: block;
text-align: center;
@ -51,26 +57,31 @@ table.shop_table_responsive {
}
@media screen and (min-width: 48em) {
table.shop_table_responsive {
thead {
display: table-header-group;
}
tbody {
th {
display: table-cell;
}
}
tr {
th, td {
th,
td {
text-align: left;
}
td {
display: table-cell;
&:before {
&::before {
display: none;
}
}

View file

@ -2,13 +2,14 @@
* WooCommerce Price Filter
*/
.widget_price_filter {
.price_slider {
margin-bottom: 1.5em;
}
.price_slider_amount {
text-align: right;
line-height: 2.4em;
line-height: 2.4;
.button {
float: left;
@ -29,7 +30,7 @@
outline: none;
background: $color__link;
box-sizing: border-box;
margin-top: -.25em;
margin-top: -0.25em;
opacity: 1;
&:last-child {
@ -38,7 +39,7 @@
&:hover,
&.ui-state-active {
box-shadow: 0 0 0 .25em rgba(#000, 0.1);
box-shadow: 0 0 0 0.25em rgba(#000, 0.1);
}
}
@ -51,11 +52,11 @@
}
.price_slider_wrapper .ui-widget-content {
background: rgba(0,0,0,0.1);
background: rgba(0, 0, 0, 0.1);
}
.ui-slider-horizontal {
height: .5em;
height: 0.5em;
}
.ui-slider-horizontal .ui-slider-range {