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

How to show border using classes while there's another border attribute in css? Should I use style attribute that moment? Question

+0
−0

Speaking to the comment, classes is better style attribute. But, if someone already have written something in CoDesign then how can I use class for that?

e.g. I had used $tgt.addClass('has-border-width-2 has-border-color-red-700');. And, target already has border in CoDesign. Now, I have to use !important for showing another border and have to stop CoDesign. Is there possible way to add !important for those classes has-border-width-2 has-border-color-red-700. I think no. Than, how to show the border and color?

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+3
−0

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:

// JavaScript
$tgt.addClass('failed-validation');
/* CSS, app/assets/stylesheets/character_count.scss */
.failed-validation {
  border: 2px solid #d21919 !important;
}
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!