From 7e75bb936cf5b2bd2fa3344e13b6c486c8ecc8a3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Aug 2019 15:27:30 +0200 Subject: Add support for setting CLI code paragraph as box, similar to pre --- code-box.css | 16 ++-------------- common.css | 1 - p-code-box.css | 24 ++++++++++++++++++++++++ pre-box.css | 2 ++ 4 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 p-code-box.css diff --git a/code-box.css b/code-box.css index 10c9154..f3d22ca 100644 --- a/code-box.css +++ b/code-box.css @@ -3,23 +3,11 @@ * license : MIT; see accompanying LICENSE file */ +/* Note: see also p-code-box.css if changing anything here. */ + code { background-color: rgba(0, 0, 0, 0.05); border-radius: 0.2em; padding: .2em .32em .18em .32em; } - -/* -code::before -{ - letter-spacing: -0.2em; - content: "\00a0"; -} - -code::after -{ - letter-spacing: -0.2em; - content: "\00a0"; -} -*/ diff --git a/common.css b/common.css index fd4cafa..c0582bd 100644 --- a/common.css +++ b/common.css @@ -274,7 +274,6 @@ code, pre } pre {white-space: pre-wrap;} - @media only screen and (max-width: 567px) { pre {word-break: break-all;} diff --git a/p-code-box.css b/p-code-box.css new file mode 100644 index 0000000..5505d23 --- /dev/null +++ b/p-code-box.css @@ -0,0 +1,24 @@ +/* file : p-code-box.css + * copyright : Copyright (c) 2014-2019 Code Synthesis Ltd + * license : MIT; see accompanying LICENSE file + */ + +/* This is the pre-like paragraph produced by CLI for code-only fragments. */ + +/* Note: see also pre-box.css. */ + +.code +{ + background-color: rgba(0, 0, 0, 0.05); + border-radius: 0.2em; + padding: .8em .4em .8em .4em; + margin: 2em -.4em 2em -.4em; /* Use margins of #content. */ +} + +/* Undo code-box.css inside .code. */ +.code code +{ + background-color: transparent; + border-radius: 0; + padding: 0; +} diff --git a/pre-box.css b/pre-box.css index 4ac504b..62b3464 100644 --- a/pre-box.css +++ b/pre-box.css @@ -3,6 +3,8 @@ * license : MIT; see accompanying LICENSE file */ +/* Note: see also p-code-box.css. */ + pre { background-color: rgba(0, 0, 0, 0.05); -- cgit v1.1