Font looks blurry after translate in Chrome Font looks blurry after translate in Chrome google-chrome google-chrome

Font looks blurry after translate in Chrome


A suggestion from a related discussion solved the issue for me: https://stackoverflow.com/a/46117022/7375996

Using calc with some offset solved the issue in my case:

transform: translate(calc(-50% + 0.5px), calc(-50% + 0.5px));


I've tried different solutions in different, sometimes scary, combinations:

  • translate3d instead of translateY
  • zoom:2; transform: scale(0.5); or zoom:0.5; transform: scale(2);
  • transform: translate(calc(-50% + 0.5px), calc(-50% + 0.5px));
  • -webkit-filter: blur(0);
  • perspective: 1000px
  • scale(1.0, 1.0)
  • -webkit-font-smoothing: subpixel-antialiased;

none of them work in july 2019.

The only solution i found for modals, that should be centered - to use a flexbox aligment instead of transform: translate.

.modal__container {  display: flex;  justify-content: center;  align-items: center;  position: fixed;  top: 0;  right: 0;  bottom: 0;  left: 0;  background: rgba(0, 0, 0, 0.5);}  .modal {    box-sizing: border-box;    max-width: 80%;    max-height: 80%;    padding: 20px;    overflow-y: auto;    background: #fff;  }
<div class="modal__container">  <div class="modal">    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.  </div></div>