From 75e212c2da519a5e7acbc6044f7b82366f1b62ab Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sat, 1 Feb 2025 10:49:40 -0500 Subject: [PATCH] fix: issue #4313 cleanup merge issues * Cleanup merge issues for fix for issue #4313. --- packages/less/src/less/functions/index.js | 2 -- .../less/src/less/functions/scroll-state.js | 23 ------------------- packages/test-data/css/_main/container.css | 19 --------------- packages/test-data/less/_main/container.less | 23 ------------------- 4 files changed, 67 deletions(-) delete mode 100644 packages/less/src/less/functions/scroll-state.js diff --git a/packages/less/src/less/functions/index.js b/packages/less/src/less/functions/index.js index 51fa81f53..160ac7523 100644 --- a/packages/less/src/less/functions/index.js +++ b/packages/less/src/less/functions/index.js @@ -13,7 +13,6 @@ import string from './string'; import svg from './svg'; import types from './types'; import style from './style'; -import scrollState from './scroll-state'; export default environment => { const functions = { functionRegistry, functionCaller }; @@ -31,7 +30,6 @@ export default environment => { functionRegistry.addMultiple(svg(environment)); functionRegistry.addMultiple(types); functionRegistry.addMultiple(style); - functionRegistry.addMultiple(scrollState); return functions; }; diff --git a/packages/less/src/less/functions/scroll-state.js b/packages/less/src/less/functions/scroll-state.js deleted file mode 100644 index fea922da4..000000000 --- a/packages/less/src/less/functions/scroll-state.js +++ /dev/null @@ -1,23 +0,0 @@ -import Variable from '../tree/variable'; -import Anonymous from '../tree/variable'; - -const scrollStateExpression = function (args) { - args = Array.prototype.slice.call(args); - switch (args.length) { - case 0: throw { type: 'Argument', message: 'one or more arguments required' }; - } - - const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)]; - - args = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', '); - - return new Anonymous(`scroll-state(${args})`); -}; - -export default { - 'scroll-state': function(...args) { - try { - return scrollStateExpression.call(this, args); - } catch (e) {} - }, -}; diff --git a/packages/test-data/css/_main/container.css b/packages/test-data/css/_main/container.css index c710e5f43..f5a17a602 100644 --- a/packages/test-data/css/_main/container.css +++ b/packages/test-data/css/_main/container.css @@ -241,22 +241,3 @@ color: purple; } } -#sticky { - position: sticky; - container-type: scroll-state; -} -@container scroll-state (stuck: top) { - #sticky-child { - font-size: 75%; - } -} -@container scroll-state (snapped: x) { - #sticky-child { - font-size: 75%; - } -} -@container scroll-state (scrollable: top) { - #sticky-child { - font-size: 75%; - } -} diff --git a/packages/test-data/less/_main/container.less b/packages/test-data/less/_main/container.less index cb02b49e0..73fd17be0 100644 --- a/packages/test-data/less/_main/container.less +++ b/packages/test-data/less/_main/container.less @@ -289,26 +289,3 @@ color: purple; } } - -#sticky { - position: sticky; - container-type: scroll-state; -} - -@container scroll-state(stuck: top) { - #sticky-child { - font-size: 75%; - } -} - -@container scroll-state(snapped: x) { - #sticky-child { - font-size: 75%; - } -} - -@container scroll-state(scrollable: top) { - #sticky-child { - font-size: 75%; - } -}