scss 自定义样式表
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss 自定义样式表相关的知识,希望对你有一定的参考价值。
{% assign oke_review_badge_color = '' %}
{% assign oke_star_rating_color = '' | url_escape %}
{% assign oke_percentage_recommended_badge_color = '' %}
{% assign oke_i_recommend_icon_color = '' %}
{% assign oke_verify_buyer_status_color = '' %}
{% assign oke_avatar_placeholder_background_color = '' %}
{% assign oke_avatar_placeholder_text_color = '' %}
{% assign oke_star_rating_bar_foreground_color = '' %}
{% assign oke_star_rating_bar_background_color = '' %}
{% assign oke_attribute_rating_bar_shading_color = '' %}
{% if oke_review_badge_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-badge--rating {
background-color: {{ oke_review_badge_color }};
}
{% endif %}
{% if oke_star_rating_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-starRating-indicator-layer--foreground {
background-image: url('data:image/svg+xml;charset=UTF-8, %3Csvg%20width%3D%2280%22%20height%3D%2214%22%20viewBox%3D%220%200%2080%2014%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22{{ oke_star_rating_color }}%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M71.996%2011.368l-3.94%202.42c-.474.292-.756.096-.628-.443l1.074-4.53-3.507-3.022c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.78%204.3%204.602.37c.552.046.666.37.237.74l-3.507%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422zM55.996%2011.368l-3.94%202.42c-.474.292-.756.096-.628-.443l1.074-4.53-3.507-3.022c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.78%204.3%204.602.37c.552.046.666.37.237.74l-3.507%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422zM40.123%2011.368l-3.94%202.42c-.475.292-.756.096-.63-.443l1.076-4.53-3.508-3.022c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.778%204.3%204.603.37c.554.046.667.37.24.74l-3.508%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422zM24.076%2011.368l-3.94%202.42c-.475.292-.757.096-.63-.443l1.076-4.53-3.507-3.022c-.422-.363-.324-.693.238-.74l4.603-.37%201.78-4.3c.21-.51.55-.512.76%200l1.78%204.3%204.602.37c.554.046.667.37.24.74l-3.508%203.02%201.074%204.532c.127.536-.146.74-.628.444l-3.94-2.422zM8.123%2011.368l-3.94%202.42c-.475.292-.756.096-.63-.443l1.076-4.53L1.12%205.792c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.778%204.3%204.603.37c.554.046.667.37.24.74l-3.508%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E');
}
{% endif %}
{% if oke_percentage_recommended_badge_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-badge--recommended {
background-color: {{ oke_percentage_recommended_badge_color }};
}
{% endif %}
{% if oke_i_recommend_icon_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-review-recommendation--yes::before {
color: {{ oke_i_recommend_icon_color }};
}
{% endif %}
{% if oke_verify_buyer_status_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-review-reviewer-profile-status--verified {
color: {{ oke_verify_buyer_status_color }};
}
{% endif %}
{% if oke_avatar_placeholder_background_color != blank or oke_avatar_placeholder_text_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-avatar {
{% if oke_avatar_placeholder_background_color != blank %}
background-color: {{ oke_avatar_placeholder_background_color }};
{% endif %}
{% if oke_avatar_placeholder_text_color != blank %}
color: {{ oke_avatar_placeholder_text_color }};
{% endif %}
}
{% endif %}
{% if oke_star_rating_bar_background_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-barGraph-layer--background {
background: {{ oke_star_rating_bar_background_color }};
}
{% endif %}
{% if oke_star_rating_bar_foreground_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-barGraph-layer--foreground {
background: {{ oke_star_rating_bar_foreground_color }};
}
{% endif %}
{% if oke_attribute_rating_bar_shading_color != blank %}
.okeReviews.okeReviews--theme .or-rg-bar-bg,
.okeReviews.okeReviews--theme .or-crg-bar-bg, {
background: {{ oke_attribute_rating_bar_shading_color }};
}
{% endif %}
.orc-collectionControlsLabel {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.orc-collectionControls {
display: flex;
flex-wrap: wrap;
margin: -9px;
align-items: stretch;
}
.orc-collectionControls .orc-collectionControls-item-label {
cursor: pointer;
border: 1px solid #ccc;
border-radius: 4px;
text-align: center;
padding: 16px;
display: flex;
flex-direction: column;
height: 100%;
}
.orc-collectionControls-item-input:checked + .orc-collectionControls-item-label {
border: 1px solid #4a5973;
box-shadow: 0 0 0 1px #4a5973;
}
.orc-collectionControls-item {
flex: 1 1 25%;
padding: 9px;
box-sizing: border-box;
}
.orc-collectionControls-item-label-heading {
display: block;
margin-bottom: 16px;
font-size: 18px;
font-weight: normal;
}
.orc-collectionControls-item-input {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.orc-collectionControls-item-label-background {
display: block;
height: 150px;
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
margin-top: auto;
}
@media only screen and (max-width: 1060px) {
.orc-collectionControls-item {
flex: 1 1 50%;
}
}
@media only screen and (max-width: 480px) {
.orc-collectionControls-item {
flex: 1 1 100%;
}
}
{{ 'okendo-reviews.scss.css' | asset_url | stylesheet_tag }}
/*
* === Colors ===
*/
{% assign oke_review_badge_color = '' %}
{% assign oke_star_rating_color = '' | url_escape %}
{% assign oke_percentage_recommended_badge_color = '' %}
{% assign oke_i_recommend_icon_color = '' %}
{% assign oke_verify_buyer_status_color = '' %}
{% assign oke_avatar_placeholder_background_color = '' %}
{% assign oke_avatar_placeholder_text_color = '' %}
{% assign oke_star_rating_bar_foreground_color = '' %}
{% assign oke_star_rating_bar_background_color = '' %}
{% assign oke_attribute_rating_bar_shading_color = '' %}
{% assign oke_attribute_rating_bar_marker_color = '' %}
{% assign oke_widget_border_color = '' %}
{% assign oke_widget_background_color = '' %}
{% assign oke_reviews_nav_count_color = '' %}
{% assign oke_reviews_tab_background_color = '' %}
/*
* === Spacing ===
*/
{% assign oke_space_below_product_page_widget = '' %}
{% assign oke_space_above_product_page_widget = '' %}
{% assign oke_space_below_star_rating_summary = '' %}
{% assign oke_space_above_star_rating_summary = '' %}
/*
* === Component Visibility ===
*/
{% assign oke_show_attributes_in_aggregate = true %}
{% assign oke_show_attributes_in_reviews = true %}
{% assign oke_show_avatars = true %}
/*
* === Misc ===
*/
{% assign oke_small_stars = false %}
/*
* === Custom Store CSS ===
*/
.okeReviews.okeReviews--theme {
}
/*
* === No need to edit below here ===
*/
{% if oke_review_badge_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-badge--rating {
background-color: {{ oke_review_badge_color }};
}
{% endif %}
{% if oke_star_rating_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-starRating-indicator-layer--foreground {
background-image: url('data:image/svg+xml;charset=UTF-8, %3Csvg%20width%3D%2280%22%20height%3D%2214%22%20viewBox%3D%220%200%2080%2014%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22{{ oke_star_rating_color }}%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M71.996%2011.368l-3.94%202.42c-.474.292-.756.096-.628-.443l1.074-4.53-3.507-3.022c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.78%204.3%204.602.37c.552.046.666.37.237.74l-3.507%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422zM55.996%2011.368l-3.94%202.42c-.474.292-.756.096-.628-.443l1.074-4.53-3.507-3.022c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.78%204.3%204.602.37c.552.046.666.37.237.74l-3.507%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422zM40.123%2011.368l-3.94%202.42c-.475.292-.756.096-.63-.443l1.076-4.53-3.508-3.022c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.778%204.3%204.603.37c.554.046.667.37.24.74l-3.508%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422zM24.076%2011.368l-3.94%202.42c-.475.292-.757.096-.63-.443l1.076-4.53-3.507-3.022c-.422-.363-.324-.693.238-.74l4.603-.37%201.78-4.3c.21-.51.55-.512.76%200l1.78%204.3%204.602.37c.554.046.667.37.24.74l-3.508%203.02%201.074%204.532c.127.536-.146.74-.628.444l-3.94-2.422zM8.123%2011.368l-3.94%202.42c-.475.292-.756.096-.63-.443l1.076-4.53L1.12%205.792c-.422-.363-.324-.693.24-.74l4.602-.37%201.778-4.3c.21-.51.55-.512.762%200l1.778%204.3%204.603.37c.554.046.667.37.24.74l-3.508%203.02%201.075%204.532c.127.536-.147.74-.628.444l-3.94-2.422z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E');
}
{% endif %}
{% if oke_percentage_recommended_badge_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-badge--recommended {
background-color: {{ oke_percentage_recommended_badge_color }};
}
{% endif %}
{% if oke_i_recommend_icon_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-review-recommendation--yes::before {
color: {{ oke_i_recommend_icon_color }};
}
{% endif %}
{% if oke_verify_buyer_status_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-review-reviewer-profile-status--verified {
color: {{ oke_verify_buyer_status_color }};
}
{% endif %}
{% if oke_avatar_placeholder_background_color != blank or oke_avatar_placeholder_text_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-avatar {
{% if oke_avatar_placeholder_background_color != blank %}
background-color: {{ oke_avatar_placeholder_background_color }};
{% endif %}
{% if oke_avatar_placeholder_text_color != blank %}
color: {{ oke_avatar_placeholder_text_color }};
{% endif %}
}
{% endif %}
{% if oke_star_rating_bar_background_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-barGraph-layer--background {
background: {{ oke_star_rating_bar_background_color }};
}
{% endif %}
{% if oke_star_rating_bar_foreground_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-barGraph-layer--foreground {
background: {{ oke_star_rating_bar_foreground_color }};
}
{% endif %}
{% if oke_attribute_rating_bar_shading_color != blank %}
.okeReviews.okeReviews--theme .or-rg-bar-bg,
.okeReviews.okeReviews--theme .or-crg-bar-bg, {
background: {{ oke_attribute_rating_bar_shading_color }};
}
{% endif %}
{% if oke_attribute_rating_bar_marker_color != blank %}
.okeReviews.okeReviews--theme .or-rg-bar-mrk,
.okeReviews.okeReviews--theme .or-crg-bar-mrk, {
background-color: {{ oke_attribute_rating_bar_marker_color }};
}
{% endif %}
{% if oke_widget_border_color != blank %}
.okeReviews.okeReviews--theme {
.okeReviews-reviewsWidget.is-okeReviews-reviewsWidget-medium,
.okeReviews-reviewsWidget.is-okeReviews-reviewsWidget-large {
.okeReviews-reviewsAggregate-side,
.okeReviews-reviewsAggregate-primary,
.okeReviews-review-side,
.okeReviews-review-primary {
border-color: {{ oke_widget_border_color }};
}
}
.okeReviews-select,
.okeReviews-select::before,
.okeReviews-button,
.okeReviews-reviewsAggregate-side,
.okeReviews-reviewsAggregate-primary,
.okeReviews-reviewsWidget-emptyMessage,
.okeReviews-qandaWidget-emptyMessage,
.okeReviews-review-reviewer-profile,
.okeReviews-reviewsWidget-loadingMessage,
.okeReviews-questions,
.okeReviews-question,
.okeReviews-reviews-showMore,
.okeReviews-showMore {
border-color: {{ oke_widget_border_color }};
}
.okeReviews-reviews-footer::before {
background-color: {{ oke_widget_border_color }};
}
}
{% endif %}
{% if oke_widget_background_color != blank %}
.okeReviews.okeReviews--theme {
.okeReviews-reviewsWidget.is-okeReviews-reviewsWidget-medium,
.okeReviews-reviewsWidget.is-okeReviews-reviewsWidget-large {
.okeReviews-reviewsAggregate-side,
.okeReviews-reviewsAggregate-primary,
.okeReviews-review-side,
.okeReviews-review-primary {
background-color: {{ oke_widget_background_color }};
}
}
.okeReviews-select,
.okeReviews-select::before,
.okeReviews-button,
.okeReviews-reviewsAggregate-side,
.okeReviews-reviewsAggregate-primary,
.okeReviews-reviewsWidget-emptyMessage,
.okeReviews-qandaWidget-emptyMessage,
.okeReviews-review-reviewer-profile,
.okeReviews-reviewsWidget-loadingMessage,
.okeReviews-questions,
.okeReviews-question,
.okeReviews-reviews-showMore,
.okeReviews-showMore {
background-color: {{ oke_widget_background_color }};
}
}
{% endif %}
{% if oke_reviews_nav_count_color != blank %}
.okeReviews.okeReviews--theme .okeReviews-widgetNavBar-count {
background-color: {{ oke_reviews_nav_count_color }};
}
{% endif %}
{% if oke_reviews_tab_background_color != blank %}
.okeReviews.okeReviews--theme {
.okeReviews-reviewsTab {
background-color: {{ oke_reviews_tab_background_color }};
}
}
{% endif %}
{% if oke_space_below_product_page_widget != blank %}
[data-oke-reviews-widget-holder] {
padding-bottom: {{ oke_space_below_product_page_widget }};
}
{% endif %}
{% if oke_space_above_product_page_widget != blank %}
[data-oke-reviews-widget-holder] {
padding-top: {{ oke_space_above_product_page_widget }};
}
{% endif %}
{% if oke_space_below_star_rating_summary != blank %}
.okeReviews.okeReviews--theme {
.okeReviews-reviewsSummary {
margin-bottom: {{ oke_space_below_star_rating_summary }};
}
}
{% endif %}
{% if oke_space_above_star_rating_summary != blank %}
.okeReviews.okeReviews--theme {
.okeReviews-reviewsSummary {
margin-top: {{ oke_space_above_star_rating_summary }};
}
}
{% endif %}
{% if oke_show_attributes_in_aggregate == false %}
.okeReviews.okeReviews--theme {
.okeReviews-reviewsAggregate-mod-itm--attRtgAv {
display: none!important;
}
.okeReviews-reviewsAggregate-mod-itm--medAgg {
padding-left: 0!important;
max-width: 196px!important;
}
}
{% endif %}
{% if oke_show_attributes_in_reviews == false %}
.okeReviews.okeReviews--theme {
.okeReviews-review-attributeRatings {
display: none;
}
}
{% endif %}
{% if oke_show_avatars == false %}
.okeReviews.okeReviews--theme {
.okeReviews-review-reviewer-profile-avatar {
display: none;
}
.okeReviews-review-reviewer-profile-details {
padding-left: 0;
padding-top: 0;
}
}
{% endif %}
{% if oke_small_stars == true %}
.okeReviews.okeReviews--theme {
.okeReviews-starRating.okeReviews-starRating--small {
height: 15px;
width: 75px;
}
.okeReviews-starRating--small .okeReviews-starRating-indicator-layer {
background-size: 75px 15px;
}
.okeReviews-starRating {
height: 20px;
width: 100px;
}
.okeReviews-starRating-indicator-layer {
background-size: 100px 20px;
}
.okeReviews-ratingsBadge {
.okeReviews-starRating-indicator-layer {
background-size: 90px 18px;
}
.okeReviews-starRating {
width: 90px;
height: 18px;
}
}
}
{% endif %}
/*
* === All reviews page css ===
*/
.orc-collectionControlsLabel {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.orc-collectionControls {
display: flex;
flex-wrap: wrap;
margin: -9px;
align-items: stretch;
}
.orc-collectionControls .orc-collectionControls-item-label {
cursor: pointer;
border: 1px solid #ccc;
border-radius: 4px;
text-align: center;
padding: 16px;
display: flex;
flex-direction: column;
height: 100%;
}
.orc-collectionControls-item-input:checked + .orc-collectionControls-item-label {
border: 1px solid #4a5973;
box-shadow: 0 0 0 1px #4a5973;
}
.orc-collectionControls-item {
flex: 1 1 25%;
padding: 9px;
box-sizing: border-box;
}
.orc-collectionControls-item-label-heading {
display: block;
margin-bottom: 16px;
font-size: 18px;
font-weight: normal;
}
.orc-collectionControls-item-input {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.orc-collectionControls-item-label-background {
display: block;
height: 150px;
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
margin-top: auto;
}
@media only screen and (max-width: 1060px) {
.orc-collectionControls-item {
flex: 1 1 50%;
}
}
@media only screen and (max-width: 480px) {
.orc-collectionControls-item {
flex: 1 1 100%;
}
}
以上是关于scss 自定义样式表的主要内容,如果未能解决你的问题,请参考以下文章
scss 具有自定义变量和样式覆盖的Bootstrap-Sass项目导入结构。
scss 具有自定义变量和样式覆盖的Bootstrap-Sass项目导入结构。
css Polylang的自定义语言切换器。包含PHP函数和SCSS样式。 HTML标记使用BEM方法。 SCSS文件是你