Translate then rotate, order is important
.test {
width: 500px;
height: 500px;
background:
linear-gradient(black,black) center/10px 10px no-repeat,
pink;
position: relative;
}
.test::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
display: inline-block;
width: 60px;
height: 60px;
border-right: 2px solid red;
border-bottom: 2px solid red;
transform: translate(-50%, -50%) rotate(135deg);
}
<div class="test"></div>
And if you want to consider only the arrow, adjust the left position:
.test {
width: 500px;
height: 500px;
background:
linear-gradient(black,black) center/10px 10px no-repeat,
pink;
position: relative;
}
.test::before {
content: '';
position: absolute;
top: 50%;
left: calc(50% + 15px);
display: inline-block;
width: 60px;
height: 60px;
border-right: 2px solid red;
border-bottom: 2px solid red;
transform: translate(-50%, -50%) rotate(135deg);
}
<div class="test"></div>
Or the translation:
.test {
width: 500px;
height: 500px;
background:
linear-gradient(black,black) center/10px 10px no-repeat,
pink;
position: relative;
}
.test::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
display: inline-block;
width: 60px;
height: 60px;
border-right: 2px solid red;
border-bottom: 2px solid red;
transform: translate(-25%, -50%) rotate(135deg);
}
<div class="test"></div>