Active
Project:
UI Skins
Version:
1.1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Jul 2024 at 16:10 UTC
Updated:
8 Aug 2024 at 19:56 UTC
Jump to comment: Most recent
Comments
Comment #2
g4mbiniComment #3
pdureau commentedOKLCH is interesting and can be considered in a bigger scope.
When we created UI Skins, we took inspiration from UI Patterns Settings & Layout Options, so we used form elements plugin ID: textfield, color, checkbox...
Today, UI Patterns Settings & Layout Options are getting merged into UI Patterns 2 which is using JSON Schema for typing, instead of form elements plugin ID. Also UI Icons is leveraging JSON Schema for the icon options.
Why not decoupling data structure from form building in CSS variables too?
We can take the CSS data types:
integerOne or more decimal units 0 through 9.
numberReal numbers which may also have a fractional component, for example 1 or 1.34.
dimensionA number with a unit attached to it, for example 23px or 15em.
percentageA number with a percentage sign attached to it, for example 10%.
ratioA ratio, written with the syntax
number / number.flexA flexible length introduced for CSS grid layout, written as a
numberwith thefrunit attached and used for grid track sizing.lengthLengths are a
dimensionand refer to distances.angleAngles are used in properties such as
linear-gradient()and are adimensionwith one ofdeg,grad,rad, orturnunits attached.timeDuration units are a
dimensionwith ansormsunit.frequencyFrequencies are a
dimensionwith aHzorkHzunit attached.resolutionIs a
dimensionwith a unit identifier ofdpi,dpcm,dppx, orx.length-percentageA type that can accept a length or a percentage as a value.
frequency-percentageA type that can accept a frequency or a percentage as a value.
angle-percentageA type that can accept an angle or a percentage as a value.
time-percentageA type that can accept a time or a percentage as a value.
colorSpecified as a keyword or a numerical color value.
alpha-valueSpecifies the transparency of a color. May be a
number, in which case 0 is fully transparent and 1 is fully opaque, or apercentage, in which case 0% is fully transparent and 100% fully opaque.hueSpecifies the
angle, with a unit identifier ofdeg,grad,rad, orturn, or unitlessnumberinterpreted asdeg, of the color wheel specific to theabsolute-color-functionsof which it is a component.imageA URL reference to an image or a color gradient.
color-stop-listA list of two or more color stops with optional transition information using a color hint.
linear-color-stopA
colorand alength-percentageto indicate the color stop for this part of the gradient.linear-color-hintA
length-percentageto indicate how the color interpolates.ending-shapeUsed for radial gradients; can have a keyword value of
circleorellipse.sizeDetermines the size of the radial gradient's ending shape. This accepts a value of a keyword or a
lengthbut not a percentage.positionDefines the position of an object area. Accepts a keyword value such as
toporleft, or alength-percentage.calc-sumA calculation which is a sequence of calculation values interspersed with addition (
+) and subtraction (-) operators. This data type requires both values to have units.calc-productA calculation which is a sequence of calculation values interspersed with multiplication (
*) and division (/) operators. When multiplying, one value must be unitless. When dividing, the second value must be unitless.calc-valueDefines accepted values for calculations, values such as
calc-sumcalculations.calc-keywordDefines a number of CSS keywords representing numeric constants such as
eandπ, that can be used in CSS math functions.https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
Or the new design tokens data types:
https://design-tokens.github.io/community-group/format/#types
Comment #4
grimreaperSo, duplicate of #3403788: UX: Add other widgets ?
Comment #5
pdureau commentedYes, but not using the Drupal form elements as data type. We need to bad this practice. And promote the use of proper well-defined, industry standard, data types.