Skip to content

Instantly share code, notes, and snippets.

@harikt
Created November 27, 2012 18:12
Show Gist options
  • Save harikt/4155974 to your computer and use it in GitHub Desktop.
Save harikt/4155974 to your computer and use it in GitHub Desktop.
Style sheet switcher : This can switch from one default style sheet to another easily.
<html>
<head>
<title>Hello World</title>
<link rel="stylesheet" href="styles/default.css">
<link rel="alternate stylesheet" href="styles/arta.css" title="arta">
<link rel="alternate stylesheet" href="styles/ascetic.css" title="ascetic">
<link rel="alternate stylesheet" href="styles/brown_paper.css" title="brown_paper">
<link rel="alternate stylesheet" href="styles/dark.css" title="dark">
<link rel="alternate stylesheet" href="styles/far.css" title="far">
<link rel="alternate stylesheet" href="styles/github.css" title="github">
<link rel="alternate stylesheet" href="styles/googlecode.css" title="googlecode">
<link rel="alternate stylesheet" href="styles/idea.css" title="idea">
<link rel="alternate stylesheet" href="styles/ir_black.css" title="ir_black">
<link rel="alternate stylesheet" href="styles/magula.css" title="magula">
<link rel="alternate stylesheet" href="styles/monokai.css" title="monokai">
<link rel="alternate stylesheet" href="styles/pojoaque.css" title="pojoaque">
<link rel="alternate stylesheet" href="styles/raibow.css" title="raibow">
<link rel="alternate stylesheet" href="styles/school_book.css" title="school_book">
<link rel="alternate stylesheet" href="styles/solarized_dark.css" title="solarized_dark">
<link rel="alternate stylesheet" href="styles/solarized_light.css" title="solarized_light">
<link rel="alternate stylesheet" href="styles/sunburst.css" title="sunburst" title="arta">
<link rel="alternate stylesheet" href="styles/tomorrow.css" title="tomorrow">
<link rel="alternate stylesheet" href="styles/tomorrow-night.css" title="tomorrow-night">
<link rel="alternate stylesheet" href="styles/tomorrow-night-blue.css" title="tomorrow-night-blue">
<link rel="alternate stylesheet" href="styles/tomorrow-night-bright.css" title="tomorrow-night-bright">
<link rel="alternate stylesheet" href="styles/tomorrow-night-eighties.css" title="tomorrow-night-eighties">
<link rel="alternate stylesheet" href="styles/vs.css" title="vs">
<link rel="alternate stylesheet" href="styles/x-code.css" title="x-code">
<link rel="alternate stylesheet" href="styles/zenburn.css" title="zenburn">
<script src="highlight.pack.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
$(function() {
$('#switch').change(function() {
var sheet = $("select option:selected").text();
$('link[rel*=style][title]').each(function(i) {
this.disabled = true;
if (this.getAttribute('title') == sheet)
this.disabled = false;
});
});
});
</script>
</head>
<body>
<select name="switch" id="switch">
<option value="arta">arta</option>
<option value="ascetic">ascetic</option>
<option value="brown_paper">brown_paper</option>
<option value="dark">dark</option>
<option value="far">far</option>
<option value="github">github</option>
<option value="googlecode">googlecode</option>
<option value="idea">idea</option>
<option value="ir_black">ir_black</option>
<option value="magula">magula</option>
<option value="monokai">monokai</option>
<option value="pojoaque">pojoaque</option>
<option value="raibow">raibow</option>
<option value="school_book">school_book</option>
<option value="solarized_dark">solarized_dark</option>
<option value="solarized_light">solarized_light</option>
<option value="sunburst">sunburst</option>
<option value="tomorrow">tomorrow</option>
<option value="tomorrow-night">tomorrow-night</option>
<option value="tomorrow-night-blue">tomorrow-night-blue</option>
<option value="tomorrow-night-bright">tomorrow-night-bright</option>
<option value="vs">vs</option>
<option value="x-code">x-code</option>
<option value="zenburn">zenburn</option>
</select>
<pre>
<code class="php">&lt;php echo "Hello World";</code>
</pre>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment