How to set a property on a pseudo-element using js or jquery?

I understand that pseudoelement are outside the DOM tree and cannot be treated as simple HTML elements.
We need to implement such a scheme, or something similar:
$('pseudo-elements').css('box-shadow', 'inset 0px 0px 0px 2px'+color); where color is a variable.
The idea is the following, there is a block, he exposed the background at the same time to the block applied opacity. A pseudo-element (::after) I made the border. When you select the color of the block with js I pull the color insert into a variable and apply the pseudo-element. It turns the color of the background and border are the same, but due to the opacity of the frame becomes pronounced.
March 12th 20 at 08:03
1 answer
March 12th 20 at 08:05
Only this:

Find more questions by tags Web DevelopmentjQueryJavaScriptCSS