Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Q&A

Post History

#1: Initial revision by user avatar ArtOfCode‭ · 2021-09-02T10:59:11Z (3 months ago)
You should almost _never_ use a `style` attribute. They're clunky, they mix HTML with CSS meaning you can't preload it, and they override just about everything else.

Instead, either use atomic classes from Co-Design, or if that doesn't work add a class of your own and write some custom CSS.

In this case, perhaps try something like this:

```js
// JavaScript
$tgt.addClass('failed-validation');
```

```css
/* CSS, app/assets/stylesheets/character_count.scss */
.failed-validation {
  border: 2px solid #d21919 !important;
}
```