5601border-top: 1px solid rgba(${colorRgb.join(',')}, 1.0);5602}5603#rec${recid} .t-store__tabs__item-button:not(.t-store__tabs__item-button_active) {5604border-bottom: 1px solid rgba(${colorRgb.join(',')}, 1.0);5605}5606`;5607t_store_createСssStyleTag('js-store-tabs-items-styles-' + recid, cssRule);5608}5609} catch (error) {5610console.error('Error when parse title_typo config', error);5611}5612
}/** * Копирует типографику во все элементы сниппета товара * @param {string} recid - ID записи * @param {TildaStoreOptions} options - Объект настроек с различными настройками типографики */function t_store_snippet_copyTypographyToSnippet(recid, options) { const rec = document.getElementById('rec' + recid); const snippetContainer = rec.querySelector('.t-store__product-snippet'); const bgColor = options.popup_opts.containerBgColor; // Применяем стили для каждого типа текстового блока t_store_setProductNameStyles(snippetContainer, recid, options, bgColor); t_store_setProductDescriptionStyles(snippetContainer, recid, options, bgColor); t_store_setProductPriceStyles(snippetContainer, recid, options, bgColor); t_store_setProductOldPriceStyles(snippetContainer, recid, options, bgColor); t_store_setProductOptionsStyles(recid, options); t_store_setProductCharacteristicsStyles(snippetContainer, recid, options); t_store_setProductBrandStyles(snippetContainer, recid, options); t_store_setProductSkuStyles(snippetContainer, recid, options); t_store_setRelevantsSliderStyles(recid, options); t_store_setProductTabsStyles(snippetContainer, recid, options);}/** * @typedef {Object} IncludeCSSProps * @property {boolean} [color] - Включить свойство color * @property {boolean} [font-size] - Включить свойство font-size * @property {boolean} [font-family] - Включить свойство font-family * @property {boolean} [line-height] - Включить свойство line-height * @property {boolean} [font-weight] - Включить свойство font-weight * @property {boolean} [letter-spacing] - Включить свойство letter-spacing * @property {boolean} [margin-top] - Включить свойство margin-top * @property {boolean} [margin-bottom] - Включить свойство margin-bottom * @property {boolean} [opacity] - Включить свойство opacity * @property {boolean} [text-transform] - Включить свойство text-transform * @property {boolean} [text-shadow] - Включить свойство text-shadow *//** * Применяет набор стилевых настроек (типографика / отступы / оформление) к переданному селектору. * JSON-конфиг содержит пары ключ-значение. Ключи с постфиксом `_res_480` интерпретируются * как мобильные (медиа `max-width:480px`) и попадают в отдельный блок. * @param {string} recid id записи * @param {string} selector CSS селектор (например, '.my-class' или '#id'). Считается корректным (не валидируется). * @param {string} jsonConfig JSON-строка с настройками. При пустом значении функция завершается. * @param {string} styleId Идентификатор <style> тега. Если не передан — генерируется из селектора. * @param {IncludeCSSProps} [includeProps] Объект включаемых CSS-свойств. Если передан, в результирующий CSS попадут только указанные свойства. Если не передан, включаются все свойства. * @returns {void} */function t_store_parseTypoStylesConfig(recid, selector, jsonConfig, styleId, includeProps) { if (!jsonConfig || !styleId) return; // ранний выход если нет данных try { const configObj = JSON.parse(jsonConfig); if (!configObj || typeof configObj !== 'object') return; // Разделяем значения на desktop / mobile одним проходом const baseConfig = {}; const mobileConfig = {}; Object.keys(configObj).forEach(key => { const val = configObj[key]; if (key.includes('lineheight') && val === '0') return; if (t_store_isEmptyValue(val)) return; if (/_res_480$/.test(key)) { mobileConfig[key.replace(/_res_480$/, '')] = val; } else { baseConfig[key] = val; } }); const baseRules = []; const mobileRules = []; const mapSimpleProps = { color: 'color', fontsize: 'font-size', fontfamily: 'font-family', lineheight: 'line-height', fontweight: 'font-weight', letterspacing: 'letter-spacing', margintop: 'padding-top', marginbottom: 'padding-bottom', opacity: 'opacity', uppercase: 'text-transform',