code-hike / codehike

Marvellous code walkthroughs
https://codehike.org
MIT License
4.39k stars 135 forks source link

Is it possible to change the font size of the code block? #304

Closed kk-min closed 1 year ago

kk-min commented 1 year ago

In my website, I used CSS and media query to change the font-size inside the code blocks depending on the screen size. After integrating code hike, I realized that this doesn't work, presumably because code-hike overrides the css styles.

This is especially important for smaller screens where I want the code to fit the width without creating a horizontal scroll bar as it makes the reading experience bad. Is there a way to do this that I am not aware of, or is it currently not supported?

slightlybelowzen commented 1 year ago

You could probably add a custom-ch.css file and specify the media query rule, take a look at this example. You probably want to add the rule for the .ch-editor-frame and specify your media query and desired font-size.

pomber commented 1 year ago

You should be able to do it with CSS. I'll close this for now, reopen it if it's still not working, and share your CSS.