Utilizing HTML inline attributes #html #developer #programming

preview_player
Показать описание
As we move back to basics and aim to keep things simple, using the HTML First principle proves to be a strong guide. It ensures we create manageable codes for our web applications. Next on our list is the principle of utilizing HTML attributes for design and operation via inline attributes. This method enables us to employ libraries such as Tailwind or Tachyons in a more fixed manner. It eliminates the need for an intricate build phase. As an instance, here's a single line from Tailwind which lets us enjoy many of its benefits. Tailwind provides a load of pre-created and ready-to-use UI classes for CSS. Through this example, you can see how we can directly adjust our HTML to manipulate the user interface so it fulfills our application's precise needs. It's really cool. This method simplifies the development process. Everything is integrated, providing you exactly what you need, a simple, replicable and transferable setup. Isn't Tailwind pretty cool? While some may suggest employing JavaScript libraries such as Hyperscript or Alpine, I believe this adds unnecessary complexity. Our current browsers already provide many of these features. If we arrange attributes in our HTML, browsers can readily use built-in methods such as a query selector to perform exactly as CSS does. This allows us to target a group of divs or elements on a page or even series of them across different pages using a single, easy JavaScript selector with no need for extra code from an external library. Here's an example of this concept, it is as plain as a button labeled "click me" with code built right in. At the same time, they discourage the fracturing of different elements into separate files. This principle promotes unity, with all elements gathered in one place. Looking at it now, it seems obviously easier, doesn't it? The proponents admit this approach may seem to disregard the principle of 'separation of concerns,' which recommends breaking apart the data layer from visualization and function. But observing this unified, simpler format, it certainly seems like a better way, everything in one file and so much simpler. Plus, it allows for greater collaboration. Just about anyone could work with such a setup.
Рекомендации по теме
welcome to shbcf.ru