<script>
	let foo;
</script>

<div bind:this={foo}></div>

<style>
	ref:foo {
		color: red;
	}
</style>