Thanks, it worked for me. But it also hides page properties. Is there any way to show page properties while hide block properties?
UPDATE: I have solved this by adding :not(.page-properties)
my implementation: Collapse/Hide Properties Easily - #4 by hulalala