There are some cons to using both IDs and classes. One developer explained that classes cause a slowdown in the compilation of code. CSS styling is especially affected by slowdowns related to class distinctions. DOM fetching is another action that is slowed by the use of class attributes. Browsers may ignore valid attributes, and browser updates can change what is displayed. What is valid one day on one browser might be invalidated on the next day. Most browsers can ignore an HTML problem, but some will cause an issue in the site's display.
Some developers suggested entirely different options. Bootstrap was one suggestion. It works with fetching multiple DOMs. It is also important to consider search engine algorithms. Some of them deliver a penalty for coding in certain ways. A few developers use both, picking and choosing when to use each one. IDs are often used for things on a page that are unique. Classes can be used for attributes that are repeated. Some developers neither use class nor ID attributes. They instead use dynamic PHP or a block element modifier for CSS when there is already a basic HTML structure in place on the site. For more information click here https://www.reddit.com/r/web_design/comments/9tihws/do_you_guys_use_ids_anymore_or_just_use_classes/.