striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

striveneditor.css (14188B)


      1 /**
      2 ** - Editor
      3 ** - Toolbar
      4 ** - Image Menu
      5 ** - File element
      6 ** - Meta Item
      7 ** - Link Menu
      8 */
      9 
     10 /** Editor **/
     11 
     12 .striven-editor {
     13     border: 1px solid #ddd;
     14     background-color: #fff;
     15     display: flex;
     16     position: relative;
     17     flex-direction: column;
     18     font-family: 'Segoe UI', Arial;
     19     max-width: 100%;
     20 }
     21 
     22 .striven-editor .se-body {
     23     position: relative;
     24     outline: none;
     25     padding: 10px 20px;
     26     min-height: auto;
     27     max-height: auto;
     28     height: auto;
     29     word-break: break-word;
     30     padding-bottom: 25px;
     31 }
     32 
     33 .striven-editor .se-body:empty::after {
     34     content: attr(data-placeholder);
     35     color: #777;
     36 }
     37 
     38 .striven-editor .se-body table {
     39     width: max-content;
     40 }
     41 
     42 .striven-editor .se-body a {
     43     position: relative;
     44 }
     45 .striven-editor .se-body .se-image-wrapper {
     46     position: relative;
     47     display: inline-block;
     48 }
     49 .striven-editor .se-body .se-image-wrapper .resize-marker {
     50     position: absolute;
     51     border: 1px dashed #0096fd;
     52     top: 0;
     53     left: 0;
     54     width: 100%;
     55     height: 100%;
     56     pointer-events: none;
     57 }
     58 .striven-editor .se-body .se-image-wrapper img {
     59     max-width: 100%;
     60 }
     61 
     62 .striven-editor .se-body .se-image-wrapper .resize-handle {
     63     position: absolute;
     64     width: 10px;
     65     height: 10px;
     66     background: rgb(255, 255, 255);
     67     border: 1px solid #0096fd;
     68     cursor: pointer;
     69 }
     70 
     71 /* Positioning resize handles */
     72 .striven-editor .se-body .se-image-wrapper .resize-handle.top-left {
     73     top: -5px;
     74     left: -5px;
     75     cursor: nwse-resize;
     76 }
     77 
     78 .striven-editor .se-body .se-image-wrapper .resize-handle.top-right {
     79     top: -5px;
     80     right: -5px;
     81     cursor: nesw-resize;
     82 }
     83 
     84 .striven-editor .se-body .se-image-wrapper .resize-handle.bottom-left {
     85     bottom: -5px;
     86     left: -5px;
     87     cursor: nesw-resize;
     88 }
     89 
     90 .striven-editor .se-body .se-image-wrapper .resize-handle.bottom-right {
     91     bottom: -5px;
     92     right: -5px;
     93     cursor: nwse-resize;
     94 }
     95 
     96 .striven-editor .se-body .se-image-wrapper .resize-handle.top-middle {
     97     top: -5px;
     98     left: 50%;
     99     transform: translateX(-50%);
    100     cursor: ns-resize;
    101 }
    102 
    103 .striven-editor .se-body .se-image-wrapper .resize-handle.bottom-middle {
    104     bottom: -5px;
    105     left: 50%;
    106     transform: translateX(-50%);
    107     cursor: ns-resize;
    108 }
    109 
    110 .striven-editor .se-body .se-image-wrapper .resize-handle.left-middle {
    111     left: -5px;
    112     top: 50%;
    113     transform: translateY(-50%);
    114     cursor: ew-resize;
    115 }
    116 
    117 .striven-editor .se-body .se-image-wrapper .resize-handle.right-middle {
    118     right: -5px;
    119     top: 50%;
    120     transform: translateY(-50%);
    121     cursor: ew-resize;
    122 }
    123 
    124 .striven-editor .se-body .se-link-options,
    125 .striven-editor .se-body .se-image-options {
    126     position: absolute;
    127     left: 10px;
    128     bottom: -25px;
    129     padding: 5px;
    130     background-color: #fff;
    131     min-width: max-content;
    132     border: 1px solid #ddd;
    133     box-shadow: 5px 5px 5px #000;
    134     font-size: 12px;
    135     font-style: normal;
    136     font-weight: normal;
    137     z-index: 1;
    138 }
    139 
    140 .striven-editor .se-image-menu-tab {
    141     padding-top: 5px;
    142     border-top: 1px solid #ccc;
    143 }
    144 
    145 .striven-editor .se-body .se-link-options span,
    146 .striven-editor .se-body .se-image-options span {
    147     cursor: pointer;
    148     color: #428bca;
    149     text-decoration: underline;
    150     user-select: none;
    151 }
    152 
    153 .striven-editor .se-body .se-link-options span:first-child:after {
    154     content: '|';
    155     margin: 0 5px;
    156     color: #000;
    157 }
    158 
    159 .striven-editor .se-file-drop-dropzone {
    160     border: 2px dashed #ddd;
    161     background-color: rgba(0, 0, 0, 0.025);
    162     display: flex;
    163     flex-direction: column;
    164     justify-content: center;
    165     align-items: center;
    166 }
    167 
    168 .striven-editor .se-file-drop-dropzone.dropzone-hot {
    169     border: 2px dashed #428bca;
    170 }
    171 
    172 .striven-editor .se-file-drop-dropzone.dropzone-overlay {
    173     height: 90%;
    174     width: 95%;
    175     left: 0;
    176     right: 0;
    177     bottom: 0;
    178     top: 0;
    179     margin: auto;
    180     position: absolute;
    181 }
    182 
    183 .striven-editor .se-file-drop-dropzone p {
    184     padding: 5px;
    185     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    186     color: #777;
    187     user-select: none;
    188     text-align: center;
    189     font-size: 25px;
    190 }
    191 
    192 .striven-editor .se-popup .se-file-drop-dropzone p {
    193     font-size: 16px;
    194 }
    195 
    196 .striven-editor .se-file-drop-dropzone svg > path {
    197     fill: #777 !important;
    198 }
    199 
    200 
    201 .striven-editor.se-image-uploading::after,
    202 .striven-editor.se-image-uploading:empty::after {
    203     content: '';
    204     position: absolute;
    205     top: 0;
    206     left: 0;
    207     right: 0;
    208     bottom: 0;
    209     background-color: rgba(255, 255, 255, 0.8);
    210     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Ecloud-arrow-up-outline%3C/title%3E%3Cg %3E%3Cpath fill='%23666' d='M4.03 12.03C3.34 12.71 3 13.53 3 14.5S3.34 16.29 4.03 17C4.71 17.66 5.53 18 6.5 18H13.09C13.04 18.33 13 18.66 13 19C13 19.34 13.04 19.67 13.09 20H6.5C5 20 3.69 19.5 2.61 18.43C1.54 17.38 1 16.09 1 14.58C1 13.28 1.39 12.12 2.17 11.1S4 9.43 5.25 9.15C5.67 7.62 6.5 6.38 7.75 5.43S10.42 4 12 4C13.95 4 15.6 4.68 16.96 6.04C18.32 7.4 19 9.05 19 11C20.15 11.13 21.1 11.63 21.86 12.5C22.37 13.07 22.7 13.71 22.86 14.42C21.82 13.54 20.5 13 19 13C18.89 13 18.79 13 18.68 13C18.62 13 18.56 13 18.5 13H17V11C17 9.62 16.5 8.44 15.54 7.46C14.56 6.5 13.38 6 12 6S9.44 6.5 8.46 7.46C7.5 8.44 7 9.62 7 11H6.5C5.53 11 4.71 11.34 4.03 12.03M16 18H18V22H20V18H22L19 15L16 18Z' /%3E%3Canimate attributeName='opacity' values='0.2; 1; 0.2' dur='1.5s' repeatCount='indefinite' /%3E%3C/g%3E%3C/svg%3E");
    211     background-size: 128px;
    212     background-position: center;
    213     background-repeat: no-repeat;
    214 }
    215 
    216 /** Toolbar **/
    217 
    218 .striven-editor .se-toolbar {
    219     display: flex;
    220     justify-content: space-between;
    221     flex-wrap: wrap;
    222     min-height: 40px;
    223     transition: height 200ms;
    224 }
    225 
    226 .striven-editor .se-toolbar .se-divider-section {
    227     height: 100%;
    228     width: 5px;
    229     display: flex;
    230     justify-content: center;
    231     align-items: center;
    232 }
    233 
    234 .striven-editor .se-toolbar .se-divider-section .se-divider-bar {
    235     height: 50%;
    236     width: 1px;
    237     background-color: #ddd;
    238 }
    239 
    240 @media (max-width: 1000px) {
    241     .striven-editor .se-toolbar .se-divider-section {
    242         display: none;
    243     }
    244 }
    245 
    246 .striven-editor .se-html .se-toolbar-group {
    247     display: none !important;
    248 }
    249 
    250 .striven-editor .se-html .se-toolbar-selection {
    251     display: none !important;
    252 }
    253 
    254 .striven-editor .se-html .se-divider-section {
    255     display: none !important;
    256 }
    257 
    258 .striven-editor .se-html .se-toolbar-menu {
    259     display: none !important;
    260 }
    261 
    262 .striven-editor .se-toolbar-close {
    263     height: 0px;
    264 }
    265 
    266 .striven-editor .se-toolbar.se-toolbar-top {
    267     align-items: flex-start;
    268 }
    269 
    270 .striven-editor .se-toolbar.se-toolbar-bottom {
    271     align-items: flex-end;
    272 }
    273 
    274 .striven-editor .se-toolbar-options {
    275     display: flex;
    276     margin-right: 10px;
    277 }
    278 
    279 .striven-editor .se-toolbar-option {
    280     border: 1px solid transparent;
    281     display: inline-block;
    282     padding: 4px 7px;
    283     cursor: pointer;
    284     user-select: none;
    285     line-height: 2em;
    286 }
    287 
    288 .striven-editor .se-toolbar-option svg {
    289     width: 16px;
    290     height: 14px;
    291 }
    292 
    293 .striven-editor .se-toolbar-option img {
    294     width: 16px;
    295     height: 14px;
    296     vertical-align: middle;
    297 }
    298 
    299 .striven-editor .se-toolbar .se-arrow-span svg {
    300     transform: translateY(2px);
    301 }
    302 
    303 .striven-editor .se-toolbar.se-toolbar-bottom .se-arrow-span svg {
    304     transform: rotate(180deg) translateY(-3px);
    305 }
    306 
    307 .striven-editor .se-toolbar-option.se-toolbar-option-active {
    308     border: 1px solid rgba(0, 0, 0, 0.25);
    309     background-color: #d4e7fc;
    310 }
    311 
    312 .striven-editor .se-toolbar-option:hover.se-toolbar-option-active {
    313     background-color: #b6d6fa;
    314 }
    315 
    316 .striven-editor .se-toolbar-group {
    317     z-index: 500;
    318     background-color: transparent;
    319     display: flex;
    320     align-items: stretch;
    321 }
    322 
    323 .striven-editor .se-toolbar-group[data-open='true'] {
    324     z-index: 999;
    325 }
    326 
    327 /* 
    328 .striven-editor .se-toolbar-group:after {
    329   content: '';
    330   margin: 0 auto;
    331   padding-bottom: 5px; 
    332   border-right: 1px solid #ddd;
    333 }
    334 */
    335 
    336 /*
    337 .striven-editor .se-toolbar-group[data-open='true'] .se-toolbar-option {
    338   background-color: #fff;
    339   border: 1px solid #ddd;
    340 }
    341 
    342 .striven-editor .se-toolbar-group[data-open='true'] .se-toolbar-option:hover {
    343   background-color: #eee;
    344 }
    345 */
    346 
    347 .striven-editor .se-toolbar-option > svg {
    348     transform: scale(1); /* chrome bug fix */
    349     vertical-align: middle;
    350 }
    351 
    352 .striven-editor .se-toolbar-option:hover,
    353 .striven-editor .se-toolbar-option:focus,
    354 .striven-editor .se-toolbar-option:active {
    355     background-color: #eee;
    356     border-color: transparent;
    357 }
    358 
    359 .striven-editor .se-toolbar #toolbar-template {
    360     min-height: 40px;
    361     flex-grow: 1;
    362     justify-content: flex-end;
    363 }
    364 
    365 .striven-editor .se-toolbar .se-toolbar-selection {
    366     display: flex;
    367     justify-content: center;
    368     align-items: center;
    369     background-color: transparent;
    370     cursor: pointer;
    371     padding: 0 5px;
    372     transition: background-color 100ms;
    373 }
    374 
    375 .striven-editor .se-toolbar .se-toolbar-selection:hover {
    376     background-color: #eee;
    377 }
    378 
    379 .striven-editor .se-toolbar .se-toolbar-selection p {
    380     margin: 0;
    381     background-color: transparent;
    382 }
    383 
    384 /*
    385 .striven-editor .se-toolbar .se-toolbar-selection .se-toolbar-option {
    386   border: 1px solid #ddd; 
    387   user-select: none;
    388   margin: 0;
    389   padding: 5px 15px;
    390   font-size: 14px;
    391   text-align: center;
    392   background-color: #eee;
    393   transition: background-color 100ms;
    394   cursor: pointer;
    395 }
    396 
    397 .striven-editor .se-toolbar .se-toolbar-selection .se-toolbar-option:hover {
    398   background-color: #ddd;
    399 }
    400 */
    401 
    402 .striven-editor .se-toolbar .se-toolbar-color {
    403     height: 16px;
    404     width: 16px;
    405 }
    406 
    407 .striven-editor .se-toolbar .se-toolbar-colorholder {
    408     /* padding: 4px;          */
    409     /* border: 1px solid #ddd;*/
    410     /* background-color: #eee;*/
    411     transition: background-color 100ms;
    412 }
    413 
    414 .striven-editor .se-toolbar .se-toolbar-colorholder:hover {
    415     background-color: #ddd;
    416 }
    417 
    418 .striven-editor .se-toolbar-popup-option {
    419     padding: 10px 15px;
    420     background-color: transparent;
    421     transition: background-color 200ms;
    422     font-size: 16px;
    423     cursor: pointer;
    424 }
    425 
    426 .striven-editor .se-toolbar-popup-option:hover {
    427     background-color: #eee;
    428 }
    429 
    430 /** Toolbar Menu **/
    431 
    432 .striven-editor .se-toolbar-menu {
    433     border: 1px solid transparent;
    434     padding: 4px 7px;
    435     cursor: pointer;
    436     align-items: center;
    437     user-select: none;
    438 }
    439 
    440 .striven-editor .se-toolbar-menu:hover {
    441     background-color: #eee;
    442 }
    443 
    444 .striven-editor .se-toolbar-menu > svg {
    445     transform: scale(1); /* chrome bug fix */
    446     vertical-align: middle;
    447 }
    448 
    449 /** File Element **/
    450 
    451 .striven-editor .se-file {
    452     width: 100%;
    453     display: flex;
    454     flex-direction: column;
    455     margin: 10px;
    456     position: relative;
    457 }
    458 
    459 .striven-editor p.se-file-name {
    460     font-weight: bold;
    461     font-size: 14px;
    462     margin: 0;
    463 }
    464 
    465 .striven-editor .se-file-size {
    466     font-size: 12px;
    467     margin: 2px 0;
    468 }
    469 
    470 .striven-editor .se-remove-link {
    471     margin: 0;
    472     user-select: none;
    473     color: black;
    474     position: absolute;
    475     right: 5px;
    476     top: -5px;
    477     cursor: pointer;
    478     background-color: #fff;
    479 }
    480 .striven-editor .se-remove-link:hover,
    481 .striven-editor .se-remove-link:focus,
    482 .striven-editor .se-remove-link:active {
    483     color: #ddd;
    484 }
    485 
    486 /** Meta Item **/
    487 
    488 .striven-editor .se-meta-item {
    489     width: 100%;
    490     display: flex;
    491     margin: 10px;
    492     position: relative;
    493 }
    494 
    495 .striven-editor .se-meta-image {
    496     margin-right: 10px;
    497     height: 50px;
    498     width: 75px;
    499 }
    500 
    501 .striven-editor .se-meta-data-title {
    502     font-weight: bold;
    503     margin: 0;
    504 }
    505 
    506 .striven-editor .se-metadata-section,
    507 .striven-editor .se-files-section {
    508     display: flex;
    509     flex-wrap: wrap;
    510     z-index: 500;
    511 }
    512 
    513 /** Popup Menu **/
    514 
    515 .striven-editor .se-popup {
    516     visibility: hidden;
    517     position: absolute;
    518     background-color: #fff;
    519     border: 1px solid #ddd;
    520     padding: 5px;
    521     z-index: 999;
    522     opacity: 0;
    523     transition: opacity, transform, box-shadow, 500ms;
    524 }
    525 
    526 .striven-editor .se-popup.se-popup-top {
    527     top: 40px;
    528     transform: translateY(-30px);
    529 }
    530 
    531 .striven-editor .se-popup.se-popup-bottom {
    532     bottom: 40px;
    533     transform: translateY(30px);
    534 }
    535 
    536 .striven-editor .se-popup.se-popup-open {
    537     visibility: visible;
    538     transform: translateY(0);
    539     box-shadow: 5px 5px 5px #000;
    540     opacity: 1;
    541 }
    542 
    543 .striven-editor .se-popup-header {
    544     color: #888;
    545     font-size: 12px;
    546     margin: 0;
    547     border-bottom: 1px solid #ddd;
    548     padding-bottom: 3px;
    549 }
    550 
    551 .striven-editor .se-popup .se-popup-form {
    552     display: flex;
    553     justify-content: space-between;
    554     margin: 5px 0;
    555 }
    556 
    557 .striven-editor .se-popup .se-popup-form > .se-form-label {
    558     margin: 8px 10px 8px 0;
    559     font-size: 12px;
    560     text-align: right;
    561     margin-right: 10px;
    562 }
    563 
    564 .striven-editor .se-popup .se-popup-form > .se-form-input {
    565     outline: none;
    566     padding: 5px;
    567 }
    568 
    569 @media (min-width: 900px) {
    570     .striven-editor .se-popup .se-popup-form > .se-form-input {
    571         width: 250px;
    572     }
    573 }
    574 
    575 .striven-editor .se-popup-button-container {
    576     float: right;
    577 }
    578 
    579 .striven-editor .se-popup-button {
    580     cursor: pointer;
    581     padding: 6px 12px;
    582     border: 1px solid transparent;
    583     font-size: 14px;
    584     outline: none;
    585     color: #333;
    586     margin: 2px;
    587 }
    588 
    589 .striven-editor .se-popup-button.se-button-primary {
    590     border-color: #357ebd;
    591     background-color: #428bca;
    592     color: #fff;
    593 }
    594 .striven-editor .se-popup-button.se-button-secondary {
    595     border-color: #ccc;
    596     background-color: #fff;
    597     color: #333;
    598 }
    599 .striven-editor .se-popup-button.se-button-primary:hover,
    600 .striven-editor .se-popup-button.se-button-primary:active,
    601 .striven-editor .se-popup-button.se-button-primary:focus {
    602     background-color: #285e8e;
    603     border-color: #285e8e;
    604 }
    605 .striven-editor .se-popup-button.se-button-secondary:hover,
    606 .striven-editor .se-popup-button.se-button-secondary:active,
    607 .striven-editor .se-popup-button.se-button-secondary:focus {
    608     background-color: #d4d4d4;
    609     border-color: #8c8c8c;
    610 }
    611 
    612 /* Button tabs. Style button to look like a tab with rounded top borders */
    613 .striven-editor .se-tab-button {
    614     background-color: #f1f1f1;
    615     border: 1px solid #ccc;
    616     border-bottom: none;
    617     border-radius: 10px 10px 0 0;
    618     padding: 5px;
    619     cursor: pointer;
    620     user-select: none;
    621 }
    622 
    623 /* Active class for the active tab */
    624 .striven-editor .se-tab-button.tab-button-active {
    625     background-color: #fff;
    626     border-bottom: 1px solid #ccc;
    627 }