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
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
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?

History
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

+4
−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;
}
History
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 »