The simpliest and recommended way: paste
AFAIK, where is no legal way to hide a ribbon button based on client-side condition. Anyway, you can do this using DOM. You will need to hide an element with Id, equal to your button ribbon id + "-Large". For example, if your button has Id="Ribbon.Documents.New.MyCustomButton", you will need element with id "Ribbon.Documents.New.MyCustomButton-Large".
Final CommandUIHandler tag code will look like this:
But even if it is possible, I don't really recommend you to use this code, because it is a kind of hack, and where are some scenarios, when this solution will not work.
For example, if you insert your button into standard ribbon button group, you will have to use standard control group template for it. And these templates are resizable: this means, that if you resize your browser window, their size could change accordingly. So, the "-Large"-postfixed elements will be hidden, and, for example, the "-Middle" ones will be shown. Ok, we can hide "-Middle" also, can't we? But if user will resize his browser window back, you "-Large" button will be shown out again.