CSS syntax normalization

Problems:

1. pretty much each module uses its own unique syntax of defining
properties…

2. property namespace pollution, example: several modules have concept of
'column' and these are different columns.

As a solution: I am proposing to extend existing “functional” notation to
support named parameters:

foo(no-name-value, param1: value1,  param2: value2, …)

It supports as exiting use cases like rgb(1,2,3) with anonymous parameters
as new, property alike notation.

Having this in place we can define color-mod function [1] for example as
this:


     background: color-mod(#abc, desaturate:20%, lighten:40% );




Existing modules can benefit of named parameters too. For example bunch of
grid parameters can be combined into

single group applied as "either-all-or-none"


#grid {
    display: grid( columns: 150px 1fr,
                         rows:50px 1fr 50px );
}


rather than current approach

#grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-rows: 50px 1fr 50px;
}


Tomorrow some module will want to have its own 'grid-template-columns'  but
the name is taken by some other module.


So is this functional notation as natural namespace separation syntax.



[1] https://drafts.csswg.org/css-color/#modifying-colors



Andrew Fedoniouk

http://sciter.com

Received on Thursday, 21 December 2017 19:45:33 UTC