Каталог файловtilda-catalog-1.2.js
1001 if (styles.colorhover) {1002 // @ts-expect-error ST-2949_21003 t_catalog_addTextColorRule(textHoverRules, styles.colorhover);1004 }1005 if (styles.color_res_480) {1006 // @ts-expect-error ST-2949_21007 t_catalog_addTextColorRule(textMobileRules, styles.color_res_480);1008 }1009 1010 // Селектор кнопки в для карточке товара и в секции Смотрите также1011 const textBtnSelector = `${itemSelector} .t-btnflex__text, ${itemSelector} .t-catalog__card__btn-text`;1012
История файла и сравнение версий
const textBtnHoverSelector = `${itemSelector}:hover .t-btnflex__text, ${itemSelector}:hover .t-catalog__card__btn-text`;
1015 if (textBaseRules?.length) { 1016 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1017 // @ts-expect-error ST-2949_2 1018 css += `${textBtnSelector}{${textBaseRules.join('')}}`; 1021 if (textHoverRules?.length) { 1022 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1023 // @ts-expect-error ST-2949_2 1024 css += `\n${textBtnHoverSelector}{${textHoverRules.join('')}}`; 1027 if (textMobileRules?.length) { 1028 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1029 // @ts-expect-error ST-2949_2 1030 css += `\n@media screen and (max-width:480px){${textBtnSelector}{${textMobileRules.join('')}}}`; 1037 * Создает CSS для внешнего вида кнопки 1038 * @param {string} recid 1039 * @param {string} itemSelector 1040 * @param {Record<string, string>} styles 1041 * @param {string[]} excludedStyles 1044function t_catalog_createButtonAppereanceCss(recid, itemSelector, styles, excludedStyles) { 1045 // Универсальная схема маппинга: ключ конфига -> CSS свойство 1046 const cssPropertiesMap = { 1047 bgcolor: 'background-color', 1048 radius: 'border-radius', 1049 wrap: 'white-space', 1050 shadow: 'box-shadow', 1051 fontweight: 'font-weight', 1052 uppercase: 'text-transform', 1053 fontsize: 'font-size', 1054 fontfamily: 'font-family', 1055 lineheight: 'line-height', 1056 letterspacing: 'letter-spacing', 1059 iconposition: 'flex-direction', 1062 if (Array.isArray(excludedStyles) && excludedStyles.length) { 1063 const excludedStylesSet = new Set(excludedStyles); 1065 for (const key in cssPropertiesMap) { 1066 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 1067 // @ts-expect-error ST-2949_2 1068 if (excludedStylesSet.has(key)) delete cssPropertiesMap[key]; 1072 // Построение базовых, hover и мобильных правил 1073 const baseRules = t_catalog_buildBaseButtonCssRules(cssPropertiesMap, styles); 1074 const hoverRules = t_catalog_buildHoverCssRules(styles); 1075 const mobileRules = t_catalog_buildMobileCssRules(cssPropertiesMap, styles); 1077 const selector = `#rec${recid} ${itemSelector}`; 1078 const hoverSelector = `#rec${recid} ${itemSelector}:hover`; 1081 if (baseRules?.length) { 1082 css += `${selector}{${baseRules.join('')}}`; 1085 if (hoverRules?.length) { 1086 css += `\n${hoverSelector}{${hoverRules.join('')}}`; 1089 if (mobileRules?.length) { 1090 css += `\n@media screen and (max-width:480px){${selector}{${mobileRules.join('')}}}`; 1097 * Создает тег CSS-стилей 1098 * @param {string} styleId 1099 * @param {string} css