Simple margins in the component's CSS usually work just fine for me
margin: 10px 15px
Could you clarify what you mean by "different conditions"? When doing web work, I usually have different layouts for different screen sizes, but the spacing doesn't change when the page is resized.