If you're looking for a way to achieve this without JavaScript, consider using LESS CSS and its 'functions' feature. LESS CSS can be implemented with Ruby, ASP, or PHP.
Excitingly, there are plans to integrate LESS with JavaScript in the near future. Keep an eye on less.js for updates. This advancement is expected to be part of the upcoming LESS 2.0 release.
To start, define your function as follows:
@border-radius(@radius:10px) {
-webkit-border-radius: @radius;
border-radius: @radius;
-moz-border-radius: @radius;
}
Once defined, you can reference the function like so:
For instance:
#some-id {
@border-radius;
}
Alternatively, you can customize the radius by specifying it within the function call:
#some-id {
@border-radius(210px);
}