github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/editor/assets/style.css (about)

     1  /** Common **/
     2  /* html {
     3    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Liberation Sans",
     4      sans-serif;
     5  }
     6  body {
     7    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Liberation Sans",
     8      sans-serif;
     9    max-width: 100vw;
    10    padding:0;
    11  }
    12  
    13  * {
    14    box-sizing: border-box;
    15  }
    16  
    17  .container {
    18    width: 800px;
    19    margin: 20px auto;
    20  } */
    21  
    22  /** Prosemirror **/
    23  .ProseMirror > * + * {
    24    margin-top: 0.75em;
    25  }
    26  .ProseMirror-selectednode {
    27    outline: 3px solid #68cef8;
    28  }
    29  .ProseMirror > *:first-child {
    30    margin-top: 0;
    31  }
    32  .ProseMirror > *:last-child {
    33    margin-bottom: 0;
    34  }
    35  .ProseMirror pre {
    36    /* background: rgb(30, 30, 30); */
    37    background: #f6f8fa;
    38    border-radius: 0.25rem;
    39    /* color: #fff; */
    40    font-family: JetBrainsMono, monospace;
    41    padding: 0.75rem 1rem;
    42  }
    43  .ProseMirror pre code {
    44    background: none;
    45    color: inherit;
    46    font-size: 0.8rem;
    47    padding: 0;
    48  }
    49  .ProseMirror .is-empty::before {
    50    content: attr(data-placeholder);
    51    float: left;
    52    color: #ced4da;
    53    pointer-events: none;
    54    height: 0;
    55  }
    56  
    57  /** Editor **/
    58  .mely-editor {
    59    position: relative;
    60    border: 1px solid var(--b-line);
    61    border-radius: 0.25rem;
    62    transition: all 0.2s;
    63    max-width: 100%;
    64    padding: 5px;
    65    background: #fff;
    66    margin-bottom: 20px;
    67  }
    68  .mely-editor.mely-editor-small .mely-editor-menu-container {
    69    display: block;
    70  }
    71  .mely-editor.mely-editor-small .mely-editor-menu-container > label.switch {
    72    padding: 0 15px;
    73    text-align: right;
    74    justify-content: flex-end;
    75  }
    76  .mely-editor.mely-editor-small .mely-editor-menu-container .mely-editor-menu {
    77    align-items: flex-end;
    78  }
    79  .mely-editor.mely-editor-small label[for="use-markdown"] {
    80    padding: 0 6px;
    81    text-align: right;
    82    justify-content: flex-end;
    83  }
    84  .mely-editor.focused {
    85    border-color: rgb(89, 164, 222);
    86    box-shadow: rgb(0 116 204 / 15%) 0px 0px 0px 4px;
    87    outline: 0;
    88  }
    89  .mely-editor *:focus {
    90    outline: none;
    91    box-shadow: none;
    92  }
    93  
    94  .mely-editor-content {
    95    padding: 10px 15px;
    96    border-radius: 5px;
    97    position: relative;
    98    background: #fff;
    99  }
   100  
   101  .mely-editor-content::-webkit-scrollbar-track {
   102    border-radius: 10px;
   103    background-color: transparent;
   104  }
   105  
   106  .mely-editor-content::-webkit-scrollbar-thumb {
   107    border-radius: 10px;
   108    background-color: #ccc;
   109  }
   110  
   111  .mely-editor-content::-webkit-scrollbar-corner {
   112    background-color: transparent;
   113    border-color: transparent;
   114  }
   115  
   116  .mely-editor-content::-webkit-scrollbar {
   117    width: 10px;
   118    height: 10px;
   119    background-color: transparent;
   120  }
   121  
   122  .mely-editor-content > * {
   123    width: 100%;
   124    max-width: 100%;
   125    margin-bottom: 20px;
   126  }
   127  
   128  .mely-editor-content > textarea {
   129    height: 100%;
   130    margin: 0;
   131    font: 12pt / normal "Monaco", "Menlo", "Ubuntu Mono", "Consolas",
   132      "source-code-pro", monospace;
   133  }
   134  .element {
   135    min-height: 500px;
   136    width: 600px;
   137    margin: auto;
   138  }
   139  .ProseMirror,
   140  .mely-editor-content textarea {
   141    border: none;
   142    outline: none;
   143    box-shadow: none;
   144    height: 100%;
   145    min-height: 300px;
   146  }
   147  .mely-editor-menu-container {
   148    position: sticky;
   149    top: 0;
   150    z-index: 9;
   151    display: flex;
   152    align-items: center;
   153    width: 100%;
   154    background: #fff;
   155    min-height: 58px;
   156  }
   157  
   158  /** Table **/
   159  .ProseMirror table {
   160    border-collapse: collapse;
   161    table-layout: fixed;
   162    width: 100%;
   163    margin: 0;
   164    overflow: hidden;
   165  }
   166  .ProseMirror table td,
   167  .ProseMirror table th {
   168    box-sizing: border-box;
   169    position: relative;
   170  }
   171  .ProseMirror table td > *,
   172  .ProseMirror table th > * {
   173    margin-bottom: 0;
   174  }
   175  .ProseMirror table th {
   176    font-weight: bold;
   177    text-align: left;
   178    background-color: var(--b-line);
   179  }
   180  .ProseMirror table .selectedCell:after {
   181    z-index: 2;
   182    position: absolute;
   183    content: "";
   184    left: 0;
   185    right: 0;
   186    top: 0;
   187    bottom: 0;
   188    background: rgba(200, 200, 255, 0.4);
   189    pointer-events: none;
   190  }
   191  .ProseMirror table .column-resize-handle {
   192    position: absolute;
   193    right: -1px;
   194    top: 0;
   195    bottom: -2px;
   196    width: 4px;
   197    background-color: #adf;
   198    pointer-events: none;
   199  }
   200  .tableWrapper {
   201    overflow-x: auto;
   202  }
   203  
   204  .resize-cursor {
   205    cursor: ew-resize;
   206    cursor: col-resize;
   207  }
   208  
   209  /** Switch **/
   210  .switch {
   211    position: relative;
   212    display: inline-block;
   213    font-size: 0.7rem;
   214    font-weight: 700;
   215  }
   216  
   217  .switch input {
   218    opacity: 0;
   219    width: 0;
   220    height: 0;
   221  }
   222  
   223  .switch .slider {
   224    position: relative;
   225    cursor: pointer;
   226    bottom: 0;
   227    background-color: #ccc;
   228    -webkit-transition: 0.4s;
   229    transition: 0.4s;
   230    border-radius: 34px;
   231    width: 44px;
   232    height: 24px;
   233    padding: 3px;
   234    display: inline-block;
   235  }
   236  
   237  .switch .slider:before {
   238    -webkit-transition: 0.4s;
   239    transition: 0.4s;
   240    border-radius: 50%;
   241    width: 50%;
   242    height: 100%;
   243    position: relative;
   244    display: block;
   245    content: "";
   246    width: 50%;
   247    height: 100%;
   248    left: 0;
   249    border-radius: 50%;
   250    background: #fff;
   251    transition: left 0.1s ease;
   252  }
   253  
   254  .switch input:checked + .slider {
   255    background-color: #2196f3;
   256  }
   257  
   258  .switch input:focus + .slider {
   259    box-shadow: 0 0 1px #2196f3;
   260  }
   261  
   262  .switch input:checked + .slider:before {
   263    left: 50%;
   264  }
   265  
   266  .switch {
   267    display: flex !important;
   268    align-items: center;
   269  }
   270  
   271  /** Code block **/
   272  .mely-editor-content .code-block {
   273    position: relative;
   274  }
   275  .mely-editor-content .code-block select {
   276    position: absolute;
   277    top: 10px;
   278    right: 10px;
   279    width: auto;
   280    padding: 4px 10px 5px;
   281    font-size: 0.92rem;
   282    cursor: pointer;
   283  }
   284  .mely-editor-content .code-block.is-empty::before {
   285    display: none;
   286  }
   287  .code-block.is-empty pre {
   288    padding-bottom: 20px;
   289  }
   290  
   291  /** Task list **/
   292  ul[data-type="taskList"] {
   293    list-style: none;
   294    padding: 0;
   295  }
   296  ul[data-type="taskList"] ul:last-child {
   297    margin-bottom: 0;
   298  }
   299  ul[data-type="taskList"] p {
   300    margin: 0;
   301  }
   302  ul[data-type="taskList"] li {
   303    display: flex;
   304  }
   305  ul[data-type="taskList"] li > label {
   306    flex: 0 0 auto;
   307    margin-right: 0.5rem;
   308    user-select: none;
   309  }
   310  ul[data-type="taskList"] li > div {
   311    flex: 1 1 auto;
   312  }
   313  
   314  /** Nav menu **/
   315  .mely-editor-menu {
   316    align-items: center;
   317    display: flex;
   318    flex: 0 0 auto;
   319    flex-wrap: wrap;
   320    padding: 10px;
   321    position: sticky;
   322    top: 0;
   323    z-index: 9999;
   324    /* background: #fff; */
   325    gap: 2px;
   326  }
   327  .mely-editor-menu > * {
   328    display: inline-block;
   329    cursor: pointer;
   330    border-radius: 0.25rem;
   331    margin-right: 3px;
   332  }
   333  
   334  .mely-editor-menu .btn {
   335    margin: 0;
   336    padding: 0;
   337    width: auto;
   338    height: 30px;
   339    background: transparent;
   340    border: none;
   341    color: currentColor;
   342    line-height: 10px;
   343    display: flex;
   344    min-width: 30px;
   345    align-items: center;
   346    position: relative;
   347    opacity: 1 !important;
   348    justify-content: center;
   349    border: 1px solid transparent;
   350  }
   351  .mely-editor-menu .btn:first-child {
   352    background: #eceff454;
   353  }
   354  .mely-editor-menu .btn:first-child:hover {
   355    background: var(--b-bg-2);
   356  }
   357  .mely-editor-menu > .btn:hover,
   358  .mely-editor-menu .btn.active {
   359    background: var(--b-bg-2);
   360  }
   361  .mely-editor-menu .btn > svg {
   362    width: 24px;
   363    height: 24px;
   364    max-width: initial;
   365    position: relative;
   366  }
   367  .mely-editor-menu-container:before {
   368    content: "";
   369    background: #fff;
   370    position: absolute;
   371    top: 0;
   372    left: 0;
   373    width: 100%;
   374    height: 100%;
   375    z-index: 1;
   376  }
   377  .mely-menu-fixed:after {
   378    background: radial-gradient(
   379      50% 50% at 50% 45%,
   380      rgba(0, 0, 0, 0.8) -200%,
   381      transparent 115%
   382    );
   383    content: "";
   384    height: 62px;
   385    left: 0;
   386    opacity: 0;
   387    pointer-events: none;
   388    position: absolute;
   389    right: 0;
   390    top: -112px;
   391    transform: translateZ(-1px);
   392    transition: top 1s ease, opacity 1.5s ease;
   393    opacity: 1;
   394    top: 0;
   395    transition: top 0.2s ease, opacity 0.1s ease;
   396  }
   397  .mely-editor-menu-buttons {
   398    flex-grow: 1;
   399  }
   400  label[for="use-markdown"] {
   401    padding-right: 10px;
   402    position: relative;
   403    z-index: 2;
   404  }
   405  /* .mely-editor-menu .btn.active.has-sub-menu {
   406      margin-left: 5px;
   407  } */
   408  .mely-editor-dropdown {
   409    display: none;
   410    position: absolute;
   411    text-align: left;
   412    z-index: 99999999;
   413    opacity: 1;
   414    top: 30px;
   415    right: 0;
   416    background-color: #fff !important;
   417    border: 1px solid transparent;
   418    border-radius: 0.25rem;
   419    box-shadow: 0 0 2px 0 rgb(34 47 62 / 20%), 0 4px 8px 0 rgb(34 47 62 / 15%);
   420    overflow: hidden;
   421    vertical-align: top;
   422    padding: 0.3rem 0;
   423  }
   424  .mely-editor-dropdown-trigger:hover .mely-editor-dropdown {
   425    display: block;
   426  }
   427  .mely-editor-dropdown button {
   428    background: transparent;
   429    color: #000;
   430    display: block;
   431    width: 100%;
   432    text-align: left;
   433    font-size: 0.95rem;
   434  }
   435  .mely-editor-dropdown button:hover {
   436    background: var(--b-line);
   437  }
   438  .mely-editor-dropdown-trigger {
   439    width: 18px;
   440    height: 30px;
   441    position: relative;
   442    line-height: 26px;
   443  }
   444  .mely-editor-dropdown-trigger > svg:first-child {
   445    height: 30px;
   446  }
   447  
   448  .mely-editor-menu > .btn.has-sub-menu:hover,
   449  .mely-editor-menu .btn.has-sub-menu.active {
   450    border-color: var(--b-bg-2);
   451    background: transparent;
   452  }
   453  .mely-editor-menu > .btn.has-sub-menu:hover > *:hover {
   454    background-color: var(--b-bg-2);
   455  }
   456  .mely-editor-menu > .btn.has-sub-menu:hover > svg,
   457  .mely-editor-menu .btn.has-sub-menu.active > svg {
   458    background: var(--b-bg-2);
   459  }
   460  button.btn.has-sub-menu > svg:first-child {
   461    padding: 0 3px 0 3px;
   462    width: 30px;
   463    height: 30px;
   464  }
   465  
   466  /** Bubble */
   467  .tippy-box[data-theme~="light"] {
   468    box-shadow: 0 0 20px 4px rgb(154 161 177 / 15%),
   469      0 4px 80px -8px rgb(36 40 47 / 25%), 0 4px 4px -2px rgb(91 94 105 / 15%) !important;
   470  }
   471  .tippy-content {
   472    padding: 5px;
   473  }
   474  [data-tippy-root] {
   475    max-width: calc(100vw - 10px);
   476    width: auto;
   477  }
   478  .mely-tiptap-editor[hidden] + [data-tippy-root] {
   479    visibility: hidden !important;
   480    display: none !important;
   481  }
   482  .mely-bubble.mely-bubble-inline {
   483    display: flex;
   484    align-items: center;
   485    gap: 6px;
   486  }
   487  
   488  .mely-editor-bubble-content {
   489    display: flex;
   490    flex-direction: column;
   491    gap: 5px;
   492  }
   493  .mely-editor-bubble-inline-actions {
   494    display: flex;
   495    justify-content: right;
   496    gap: 5px;
   497    align-items: flex-end;
   498  }
   499  
   500  /** Node view block **/
   501  .mely-editor-block {
   502    text-align: center;
   503    border: 1px solid transparent;
   504  
   505    margin: 20px 0;
   506    font-size: initial;
   507    font-weight: initial;
   508  }
   509  .mely-editor-block.block-img.uploading {
   510    position: relative;
   511  }
   512  
   513  .mely-editor-block.block-img.uploading:before {
   514    content: "Uploading...";
   515    position: absolute;
   516    width: 100%;
   517    height: 100%;
   518    background: rgb(0 0 0 / 82%);
   519    left: 0;
   520    top: 0;
   521    color: #fff;
   522    border-radius: 0.25rem;
   523    display: flex;
   524    align-items: center;
   525    justify-content: center;
   526  }
   527  .mely-editor-block:hover {
   528    box-shadow: rgb(0 116 204 / 15%) 0px 0px 0px 4px;
   529  }
   530  .mely-editor-block-view {
   531    background: var(--b-bg-2);
   532    padding: 10px;
   533  }
   534  
   535  .mely-editor-block-view input {
   536    background: #fff;
   537    caret-color: initial;
   538    line-height: 1;
   539    padding: 0.25rem 0.75rem;
   540  }
   541  
   542  .mely-editor-block-view p {
   543    margin: 5px 0;
   544    color: #666;
   545  }
   546  
   547  /** Image plugin **/
   548  .mely-editor-block.block-img img {
   549    margin: auto;
   550    display: block;
   551  }
   552  .mely-editor-block.block-img img[src=""] {
   553    display: none;
   554  }
   555  .mely-editor-block.block-img img[src]:not([src=""]) + .mely-editor-block-view {
   556    display: none;
   557  }
   558  .mely-editor-img-url {
   559    display: flex;
   560    gap: 10px;
   561  }
   562  
   563  /** Iframe **/
   564  .mely-editor-block.block-iframe iframe {
   565    margin: auto;
   566    display: block;
   567  }
   568  .mely-editor-block.block-iframe iframe[src=""] {
   569    display: none;
   570  }
   571  .mely-editor-block.block-iframe
   572    iframe[src]:not([src=""])
   573    + .mely-editor-block-view {
   574    display: none;
   575  }
   576  .mely-editor-iframe-src {
   577    display: flex;
   578    gap: 10px;
   579  }
   580  
   581  /** Editor content **/
   582  th > *:last-child,
   583  td > *:last-child {
   584    margin-bottom: 0;
   585  }
   586  th {
   587    text-align: left;
   588    vertical-align: bottom;
   589    white-space: nowrap;
   590    background-color: var(--b-bg-2);
   591    line-height: 1.15384615;
   592  }
   593  td,
   594  th {
   595    padding: 0.5rem 0;
   596    border-top: 1px solid var(--b-line);
   597    border-left: 1px solid var(--b-line);
   598    border-right: 1px solid var(--b-line);
   599    padding: 8px;
   600  }
   601  
   602  @media only screen and (max-width: 490px) {
   603    .mely-editor-menu-container {
   604      display: block;
   605    }
   606    label[for="use-markdown"] {
   607      padding: 0 6px;
   608      text-align: right;
   609      justify-content: flex-end;
   610    }
   611  }