# Code Block Style Picker

**URL:** <https://talk.observablehq.com/t/code-block-style-picker/2847>\
**Category:** Show and tell\
**Created:** [February 18, 2020, 12:12pm UTC](https://talk.observablehq.com/t/code-block-style-picker/2847 "2020-02-18T12:12:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anwarhahjjeffersonge](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/anwarhahjjeffersonge/32/2649_2.png) [@anwarhahjjeffersonge](https://talk.observablehq.com/u/anwarhahjjeffersonge)\
**Post date:** [February 18, 2020, 12:12pm UTC](https://talk.observablehq.com/t/code-block-style-picker/2847/1 "2020-02-18T12:12:54Z")

</div>

> **[Code Block Style Picker](https://observablehq.com/@anwarhahjjeffersongeorge/code-block-style-picker)**
>
> An Observable notebook by Anwar Hahj Jefferson-George.

Want to make code blocks stand out in Observables? Instead of writing new styles for custom appearances, you can use this notebook to pick a style already supported by highlightjs.

You can import its function `applyHljsStyle` to use it in your own notebook. Give the function a name of one of the styles found here: [https://github.com/observablehq/highlight.js/tree/master/src/styles](https://github.com/observablehq/highlight.js/tree/master/src/styles) (without the .css extension)

This just uses the `html` template function to import the relevant stylesheet. It only works with stylesheets found in the official highlightjs repo and fails silently otherwise.
