To align your class with the Bootstrap 4 grid, incorporate these elements into your class:
.your-class {font-size 2.9vw}
@media (min-width: 576px) {
/*sm equivalent*/
/*insert your class here*/
}
@media (min-width: 768px) {
/*md equivalent*/
/*insert your class here*/
}
@media (min-width: 992px) {
/*lg equivalent*/
/*insert your class here*/
.your-class {font-size 1.9vw}
}
@media (min-width: 1200px) {
/*xl equivalent*/
/*insert your class here*/
}
UPDATE:
If you want a solution exclusively using Bootstrap without media queries, duplicate your element with identical content like this:
<style>
.my-class-1 {font-size 2.9vw}
.my-class-2 {font-size 1.9vw}
</style>
<!-- Only visible on xl -->
<div class="my-class-1 d-none d-xl-block">My text</div>
<!-- Only hidden on xl -->
<div class="my-class-2 d-xl-none">My text</div>
Learn more about Bootstrap 4 display utilities, although utilizing media queries is generally more preferable.