It completely depends on what action you want to activate, but in general, yes, it is possible.
Here's an example based on width:
HTML
<div id="something-awesome"></div>
CSS
&:before {
content: "This is some great text here.";
}
}
@media (min-width: 500px) {
&:before {
content: "This is some other super great text.";
}
}
}
Here is a script showing how the example works: https://jsfiddle.net/ttLc7a4t/2/
, .