sbj Well-known member Jan 17, 2021 #1 I try to style a specific custom thread fields. I can't find out what CSS to use to target specific fields. Tried so far: CSS: [data-field="my_field"] { >.pairs > dd { background: red; } } But it doesn't work. Tried other variations but no luck so far. Anybody could help?
I try to style a specific custom thread fields. I can't find out what CSS to use to target specific fields. Tried so far: CSS: [data-field="my_field"] { >.pairs > dd { background: red; } } But it doesn't work. Tried other variations but no luck so far. Anybody could help?
Solution P P Paul B Jan 17, 2021 This should work for all thread view types, regardless of the exact template name: Less: [data-template*="thread_view"] { .pairs[data-field="test"] > dd { background: red; } } Replace test with the name of the custom thread field.
This should work for all thread view types, regardless of the exact template name: Less: [data-template*="thread_view"] { .pairs[data-field="test"] > dd { background: red; } } Replace test with the name of the custom thread field.
P Paul B XenForo moderator Staff member Jan 17, 2021 #2 Less: .formRow[data-field="test"] > dd { background: red; } Upvote 0 Downvote
sbj Well-known member Jan 17, 2021 #3 Brogan said: Less: .formRow[data-field="test"] > dd { background: red; } Click to expand... Thanks, doesn't work unfortunately. It maybe because I am using the thread status block to display the fields. Upvote 0 Downvote
Brogan said: Less: .formRow[data-field="test"] > dd { background: red; } Click to expand... Thanks, doesn't work unfortunately. It maybe because I am using the thread status block to display the fields.
P Paul B XenForo moderator Staff member Jan 17, 2021 #4 That works in the thread creation view. Which view are you trying to style it in and which specific section are you targeting? Edit: I see now - give me a minute, I'm making ciabatta. Upvote 0 Downvote
That works in the thread creation view. Which view are you trying to style it in and which specific section are you targeting? Edit: I see now - give me a minute, I'm making ciabatta.
P Paul B XenForo moderator Staff member Jan 17, 2021 #5 This should work for all thread view types, regardless of the exact template name: Less: [data-template*="thread_view"] { .pairs[data-field="test"] > dd { background: red; } } Replace test with the name of the custom thread field. Upvote 1 Downvote Solution
This should work for all thread view types, regardless of the exact template name: Less: [data-template*="thread_view"] { .pairs[data-field="test"] > dd { background: red; } } Replace test with the name of the custom thread field.
sbj Well-known member Jan 17, 2021 #6 Brogan said: This should work for all thread view types, regardless of the exact template name: Less: [data-template*="thread_view"] { .pairs[data-field="test"] > dd { background: red; } } Click to expand... Boom, it works. Thanks. I still can't get around these css classes. Like brackets, dots, arrows. Never sure which one to use when and in what order. Upvote 0 Downvote
Brogan said: This should work for all thread view types, regardless of the exact template name: Less: [data-template*="thread_view"] { .pairs[data-field="test"] > dd { background: red; } } Click to expand... Boom, it works. Thanks. I still can't get around these css classes. Like brackets, dots, arrows. Never sure which one to use when and in what order.