Getting CSS pseudo-element properties by Javascript

You probably wonder if you can access CSS pseudo-element's (like ::before or :: after) properties by Javascript.

The answer is yes, you can, but it's tricky :)

Let's assume you have following HTML/CSS

<p id="myid">some content</p>

#myid::after {
  width: 100px;
  height: 40px;
  color: blue;
  content: "Hello world";
#myid {
  color: red;

Apparently, "#myid::after" is not in the DOM tree, but following trick will allow you to get its properties:

var color = window.getComputedStyle(document.querySelector('#myid'), ':after').getPropertyValue('color')
var content = window.getComputedStyle(document.querySelector('#myid'), ':after').getPropertyValue('content')
console.log(color, content) // outputs the color and content of the pseudo-element

You might find it useful in test automation or some UI interaction manipulation.

Allow your web site for specific IP addresses using .htaccess

Hello All,
Here is small note, how to allow specific IP addresses to be accessed to your website by using .htaccess,
you may need it while maintenance website.
By assuming your hoster allows using .htaccess
all of you need it is create file named .htaccess
copy paste the code bellow (note some servers want the file be utf-8 encoded otherwise you will get 500 error)
replacing to your actual IPs.

        RewriteEngine on
	RewriteCond %{REMOTE_HOST} !^192\.168\.  #any ip from to
	RewriteCond %{REMOTE_HOST} !^192\.190\.1\.86 #just some IP that will be allowed too
	RewriteCond %{REQUEST_URI} /.*$ 
	RewriteCond %{REQUEST_URI} !/maintenance\.html$ #users that aren't allowed will see this page
	RewriteCond %{REQUEST_URI} !(css|png|jpg)$ # if maintenance.html consists images, you have to allow them either.
	RewriteRule .* maintenance.html [R=301,L]

Also you can block users by IP, by changing a little the rules above.