From: Andrew Engelbrecht Date: Fri, 26 Jul 2019 21:12:50 +0000 (-0400) Subject: generlized shared code between screen sizes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d679ca4e246da7325674e75c492726d077b39bba;p=ryf-theme.git generlized shared code between screen sizes i moved code that was duplicate for two screen sizes outside of the media queries. this should allow us to make change in one place, rather than two. --- diff --git a/css/style.css b/css/style.css index b8c3d45..5dbe19d 100644 --- a/css/style.css +++ b/css/style.css @@ -183,6 +183,13 @@ a { transition: 0.3s; } /* Product */ +@media screen and (max-width: 767px) { + .page-node-type-product .product { + max-width: 382px; + margin: 0 auto; + } +} + @media screen and (min-width: 768px) and (max-width: 991px) { .page-node-type-product .product { width: 700px; @@ -197,37 +204,42 @@ a { transition: 0.3s; } } } -@media screen and (max-width: 767px) { - .page-node-type-product .product { - max-width: 382px; - margin: 0 auto; - } +.page-node-type-product .product .field--name-field-image { + padding: 10px; - .page-node-type-product .product .field--name-field-image { - padding: 10px; + display: flex; + align-items: center; - display: flex; - align-items: center; + border: 1px solid #888; + border-radius: 10px; +} - border: 1px solid #888; - border-radius: 10px; - } +.page-node-type-product .product .field--name-field-extra-images { + padding: 5px; - .page-node-type-product .product .field--name-field-extra-images { - margin: 10px auto 0px auto; - padding: 5px; + display: flex; + align-items: center; - display: flex; - align-items: center; + border: 1px solid #888; + border-radius: 10px; +} - border: 1px solid #888; - border-radius: 10px; - } +.page-node-type-product .product .field--name-field-extra-images .field--item { + display: inline-block; + margin: auto; + padding: 5px; +} - .page-node-type-product .product .field--name-field-extra-images .field--item { - display: inline-block; - margin: auto; - padding: 5px; +.page-node-type-product .product .field--name-field-categories, .page-node-type-product .product .field--name-field-vendor { + margin: 10px 10px 20px 0px; + padding: 10px; + border: 1px solid #888; + border-radius: 10px; +} + +@media screen and (max-width: 767px) { + .page-node-type-product .product .field--name-field-extra-images { + margin: 10px auto 0px auto; } .page-node-type-product .product .field--name-body, .page-node-type-product .product .field--name-field-vendor-product-link, .page-node-type-product .product .field--name-field-certification-details, .page-node-type-product .product .field--name-field-certification-date, .page-node-type-product .product .field--name-field-source-code-links { @@ -236,10 +248,6 @@ a { transition: 0.3s; } .page-node-type-product .product .field--name-field-categories, .page-node-type-product .product .field--name-field-vendor { float: left; - margin: 10px 10px 20px 0px; - padding: 10px; - border: 1px solid #888; - border-radius: 10px; } .page-node-type-product .product .field--name-body { @@ -251,15 +259,7 @@ a { transition: 0.3s; } @media screen and (min-width: 768px) { .page-node-type-product .product .field--name-field-image { width: 382px; - padding: 10px; - - display: flex; - align-items: center; - float: left; - - border: 1px solid #888; - border-radius: 10px; } .page-node-type-product .product .field--name-field-extra-images { @@ -267,20 +267,7 @@ a { transition: 0.3s; } clear: left; width: 382px; - padding: 5px; margin-top: 10px; - - display: flex; - align-items: center; - - border: 1px solid #888; - border-radius: 10px; - } - - .page-node-type-product .product .field--name-field-extra-images .field--item { - display: inline-block; - margin: auto; - padding: 5px; } .page-node-type-product .product .field--name-body, .page-node-type-product .product .field--name-field-vendor-product-link, .page-node-type-product .product .field--name-field-certification-details, .page-node-type-product .product .field--name-field-certification-date, .page-node-type-product .product .field--name-field-source-code-links { @@ -297,12 +284,6 @@ a { transition: 0.3s; } float: left; } - .page-node-type-product .product .field--name-field-categories, .page-node-type-product .product .field--name-field-vendor { - margin: 10px 10px 20px 0px; - padding: 10px; - border: 1px solid #888; - border-radius: 10px; - } }