601602// Переходы603t_store_addRule(baseRules, 'transition-duration', styles.speedhover || '0.2s');604t_store_addRule(605baseRules,606'transition-property',607'background-color, color, border-color, box-shadow, opacity, transform'608);609t_store_addRule(baseRules, 'transition-timing-function', 'ease-in-out');610611// Добавим переменные для поддержки hover612if (styles.bgcolorhover) {
if (t_store_isGradient(styles.bgcolorhover)) { // Используем CSS переменные как и раньше t_store_addRule(baseRules, '--button-after-background-image-hover', styles.bgcolorhover); } else { t_store_addRule(baseRules, '--button-after-background-color-hover', styles.bgcolorhover); } } return baseRules;}/** * Создает массив CSS-правил при наведении * @param {Record<string, string>} styles * @returns {string[]} */function t_store_buildHoverCssRules(styles) { const hoverRules = []; if (styles.shadowhover) { t_store_addRule(hoverRules, 'box-shadow', styles.shadowhover); } if (styles.bordersize || styles.bordercolorhover) { const sizeH = styles.bordersize || '0'; const colorH = styles.bordercolorhover || styles.bordercolor || 'transparent'; if (/^0($|[^0-9])/i.test(sizeH) || sizeH === '0px') { t_store_addRule(hoverRules, 'border', 'none'); } else { t_store_addRule(hoverRules, 'border', sizeH + ' solid ' + colorH); } } if (styles.bgcolorhover) { t_store_addRule(hoverRules, 'background-color', styles.bgcolorhover); } return hoverRules;}/** * Создает массив CSS-правил для мобильных * @param {Record<string, string>} cssPropertiesMap * @param {Record<string, string>} styles * @returns {string[]} */function t_store_buildMobileCssRules(cssPropertiesMap, styles) { const MOBILE_SUFFIX = '_res_480'; const mobileRules = []; Object.keys(styles).forEach(function (key) { if (!key.includes(MOBILE_SUFFIX)) return; const baseKey = key.replace(MOBILE_SUFFIX, ''); const cssProp = cssPropertiesMap[baseKey]; if (!cssProp) return; t_store_addRule(mobileRules, cssProp, styles[key]); }); // Доп. поля для mobile (gap_res_480 уже обработается через mап выше, т.к. gap в MAP) if (styles.padding_res_480) { t_store_addRule(mobileRules, 'padding', styles.padding_res_480); } return mobileRules;}/** * Создает CSS для текста кнопки * @param {string} recid * @param {string} itemSelector * @param {Record<string, string>} styles * @returns {string} */function t_store_createButtonTextCss(recid, itemSelector, styles) { const textBaseRules = []; const textHoverRules = []; const textMobileRules = []; if (styles.color) { t_store_addTextColorRule(textBaseRules, styles.color); } if (styles.colorhover) { t_store_addTextColorRule(textHoverRules, styles.colorhover); } if (styles.color_res_480) { t_store_addTextColorRule(textMobileRules, styles.color_res_480); } // Селектор кнопки в для карточке товара и в секции Смотрите также const textBtnSelector = `${itemSelector} .t-btnflex__text, ${itemSelector} .t-store__card__btn-text`;