diff --git a/ww-config.js b/ww-config.js index 7f14170..eaee72a 100644 --- a/ww-config.js +++ b/ww-config.js @@ -1,5 +1,42 @@ +function getTextSurfaceCss(content, style) { + const css = []; + + css.push( + { + property: '--ww-text-white-space', + value: content._mapValue('_ww-text_nowrap', 'white-space', { + trueValue: 'nowrap', + falseValue: 'initial', + }), + }, + { + property: '--ww-text-overflow', + value: content._mapValue('_ww-text_nowrap', 'overflow', { + trueValue: 'hidden', + falseValue: 'initial', + }), + }, + { + property: '--ww-text-text-overflow', + value: content._mapValue('_ww-text_ellipsis', 'text-overflow', { + trueValue: 'ellipsis', + falseValue: 'initial', + }), + }, + { + property: '--ww-element-transition', + value: style.transition, + } + ); + + return css; +} + export default { inherit: ['ww-text'], + css({ content, style }) { + return getTextSurfaceCss(content, style); + }, editor: { label: { en: 'Text',