Skip to main content

Best Practice

HTML/CSS First

It is always better to start with HTML/CSS where possible. For example instead of using javascript to control modals, we can use dialog which is built into the browser.

We can use CSS to control a lot of client side visiblity and state. For example, we can use CSS to control the visibility of form elements based on the state of a checkbox. This is much easier to read and maintain than using javascript for simple cases.

This will also encourage simple web design that are easy to maintain and scale.

Web Components

When we need to use more complex complents and third party libraries such as maps, we can use web components. Web components are a set of standards that allow us to create reusable components that can be used in any web application. They are built into the browser and do not require any third party libraries.