svg.escobar.life

A simple SVG markup editor for the web

styles.css (4418B)

  1 /*  This program is free software: you can redistribute it and/or modify
  2     it under the terms of the GNU General Public License as published by
  3     the Free Software Foundation, either version 3 of the License, or
  4     (at your option) any later version.
  5 
  6     This program is distributed in the hope that it will be useful,
  7     but WITHOUT ANY WARRANTY; without even the implied warranty of
  8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9     GNU General Public License for more details.
 10 
 11     You should have received a copy of the GNU General Public License
 12     along with this program. If not, see <https://www.gnu.org/licenses/>. */
 13 
 14 :root {
 15   align-self: center;
 16   align-content: center;
 17   align-items: center;
 18 
 19   cursor: default;
 20   user-select: none;
 21   scrollbar-width: none;
 22 
 23   --background: #151226;
 24   --foreground: #dfdfdf;
 25   --accent: #90ff68;
 26 
 27   --selection: #A599E940;
 28   --dark: #0b0913;
 29 
 30   --tag: #FF4E56;
 31   --attribute: var(--accent);
 32   --string: #FFE86E;
 33   --comm: #68CDFF;
 34 
 35   --indent: 3em;
 36 }
 37 
 38 body {
 39   height: 100vh;
 40   min-height: 25vw;
 41   padding: 0;
 42   margin: 0;
 43 
 44   background: var(--background);
 45 }
 46 
 47 body, button, .elmsh, textarea {
 48   font-size: 13pt;
 49   line-height: 1.4em;
 50   font-family: monospace;
 51   color: var(--foreground);
 52 }
 53 
 54 #container {
 55   display: grid;
 56 
 57   grid-gap: 1em;
 58   grid-template-rows: 30vh auto;
 59 
 60   height: calc(100% - 2em);
 61   padding: 1em;
 62 
 63   background: var(--background);
 64 }
 65 
 66 @media (orientation: landscape) {
 67   #container {
 68     grid-template-columns: minmax(22em, 1fr) 2fr;
 69     grid-template-rows: 100%;
 70   }
 71 }
 72 
 73 #container #display img {
 74   grid-area: image;
 75 
 76   max-width: 100% !important;
 77   max-height: 100% !important;
 78 
 79   justify-self: center;
 80   align-self: center;
 81 }
 82 
 83 @media (orientation: portrait) {
 84   #container #display img#image {
 85     max-height: calc(30vh - 4.8em) !important;
 86   }
 87 }
 88 
 89 #container, #container * {
 90   transition: background-color .25s ease, fill .25s ease;
 91 }
 92 
 93 #container #display {
 94   display: grid;
 95 
 96   grid-template-rows: auto 2em;
 97   grid-template-columns: repeat(3, 1fr);
 98   grid-template-areas: "image  image  image"
 99   "button button button";
100   grid-gap: 1em;
101 
102   padding: 1em;
103   background: var(--foreground);
104   border-radius: 6pt;
105 }
106 
107 #container.dark button {
108   background: var(--foreground) !important;
109   color: var(--background) !important;
110 }
111 
112 #container.dark #display {
113   background: var(--dark);
114 }
115 
116 #container #display button {
117   grid-area: auto;
118   display: flex;
119 
120   background: var(--background);
121   border: none;
122   cursor: pointer;
123   border-radius: 6pt;
124 
125   line-height: 2em;
126   text-align: center;
127   color: var(--foreground);
128 
129   overflow-y: hidden;
130 }
131 
132 #container #display button span {
133   margin: 0 auto;
134 }
135 
136 #container #display img#error {
137   width: 100%;
138   height: 100%;
139 }
140 
141 #container #display img#error, #container.error #display img#image {
142   display: none;
143 }
144 
145 #container.error #display #error {
146   display: block;
147 }
148 
149 #container #editor {
150   position: relative;
151 
152   width: 100%;
153   height: 100%;
154 
155   overflow: hidden;
156   line-height: 1em;
157 }
158 
159 #container #editor > * {
160   position: absolute;
161   will-change: transform;
162 }
163 
164 #container #editor * {
165   margin: 0;
166 }
167 
168 #container #editor textarea {
169   z-index: 1;
170 
171   resize: none;
172   white-space: pre;
173   overflow: scroll;
174 
175   width: calc(100% - var(--indent));
176   height: 100%;
177   margin-left: var(--indent);
178 
179   outline: none;
180 
181   border: none;
182   background: transparent;
183 
184   color: transparent;
185   caret-color: var(--foreground);
186 
187   scrollbar-color: var(--foreground) transparent;
188   scrollbar-width: thin;
189 }
190 
191 #container #editor textarea::-webkit-scrollbar,
192 #container #editor textarea::-webkit-scrollbar-track {
193   width: 11px;
194   height: 11px;
195   background: transparent;
196   outline: none;
197 }
198 
199 #container #editor textarea::-webkit-scrollbar-thumb {
200   background: var(--foreground);
201   outline: none;
202 }
203 
204 #container #editor textarea::selection {
205   background: var(--selection);
206   color: transparent;
207 }
208 
209 #noscript {
210   display: flex;
211   width: 100%;
212   height: 100%;
213 }
214 
215 #noscript > * {
216   margin: auto;
217 }
218 
219 .elmsh-line::before {
220   display: inline-block;
221   width: calc(var(--indent) - 1em);
222   margin-right: 1em;
223   text-align: right;
224 
225   content: attr(data-elmsh-lc);
226   font-weight: bold;
227 }
228 
229 .elmsh-comm {
230   font-style: italic;
231   color: var(--comm);
232 }
233 
234 .elmsh , .elmsh7 { color: var(--foreground); }
235 .elmsh1, .elmsh2, .elmsh6 { color: var(--string); }
236 .elmsh3, .elmsh4 { color: var(--tag); }
237 .elmsh5 { color: var(--attribute); }
238