4 ms·
Lit doesn't use any special dialect of HTML or CSS. It's just HTML and CSS.
by colordrops 3y ago
Lit doesn't use any special dialect of HTML or CSS. It's just HTML and CSS.
- ssss11 3y agoI think they’re referring to Lit naming components ‘html’ and ‘css’ - if you go to the tech docs here the very first example imports ‘html’ and ‘css’. https://lit.dev/docs/components/overview/ https://lit.dev/docs/components/overview/ I agree that those are odd choices and the arguments provided seem reasonable I.e. they’re likely ungoogleable, and beginners would be confused.
- spankalee 3y agoIn Lit `html` and `css` are template tags, not components. Those names are well supported by editors and enable syntax highlighting. If we named them anything else it wouldn't work without extras tools.
- andrewstuart 3y agoThe fact that you are explaining this to me reinforces my point. One of my primary criteria in choosing a technology to work with its how accessible is community support, documentation, third party articles and writing. It had better be a compelling technology that names its main things exactly the same as the biggest concepts in web development, thereby making it a battle to resolve questions and issues and adding unnecessary confusion. I do use a nodejs library called "Postgres" which provides a Postgres SQL driver but I really hate the fact that searching for documentation/issues is essentially impossible. I use it because I feel I had no choice, it's the best possible technical solution. Names matter. Searchability matters a huge amount.
- mirekrusin 3y agoIt’s like complaining that sql library has tagged template function called sql - of course it will and it makes perfect sense.
- hmcdona1 3y agoSo your gripe is essentially you don't like reading the documentation of the libraries you use, just, in general? Template literals are just a feature of javascript, it's not even anything that bespoke. That's why it's called "lit". The output of those tag functions are just rendered with standard DOM features too. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- deleted 3y ago[deleted]
- spankalee 3y agoI'm curious. When are you searching for `html` and `css` and not using the https://lit.dev https://lit.dev docs, or already reading about them in some way? This is literally the first criticism I'm ever heard of the template tag names. Did you see a code snippet and want to learn more? `html` and `css` are just functions we vend. They're important ones, but two among many. The names need to be short and intuitive so that when you see something like: html`<p>Hello world</p>` both the developer and tools know what to expect of the string content. Naming them something unique would really harm readability, IMO.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- troupo 3y ago> It's just HTML and CSS. It's not, and hasn't been for a long time. It's its own DSL with unexpected constraints on what you can use with it. `<some-component attribute="string only" ?boolean=${boolean} .property=${any_js_variable} @event_name=${callback_function}> none of this is "just html" </some-component> `