1.3.0 • Published 2 years ago

@forter/highlight v1.3.0

Weekly downloads
34
License
Apache-2.0
Repository
github
Last release
2 years ago

fc-highlight

Display themed syntax highlighted code (JSON, HTML, CSS etc)

Usage

<script>
   import '@forter/highlight';
</script>

<fc-highlight>
   {
     "b": 1,
     "c": null,
     "d": "a",
     "e": true
   }
</fc-highlight>

Examples

<!-- json -->
<fc-highlight>
   {"a": {"b": 1, "c": null, "d": "a", "e": false, "f": true, "h": 0 }}
</fc-highlight>

<!-- html -->
<fc-highlight>
   <div class="hero">
     <div class="hero"></div>
     <div class="hero"></div>
    </div>
</fc-highlight>

<!-- css -->
<fc-highlight>
   .super-class {
     font-size: 15px;
    }
</fc-highlight>

<!-- javascript -->
<fc-highlight>
   import html from 'lit-html
</fc-highlight>

<!-- yaml -->
<fc-highlight>
   includes:
    - goldi
    - ori
</fc-highlight>

<!-- bash -->
<fc-highlight>
   export TEST="123"
</fc-highlight>

Properties

PropertyAttributeTypeDescription
codeInnerNodeanyinner code element
codeNodeanycode element
contentcontentstringcode language to highlight
languagelanguage"html" \| "bash" \| "javascript" \| "json" \| "css" \| "yaml"language of code language to highlight

Slots

NameDescription
content to highlight. like {"a": {"b": 1, "c": null, "d": "a", "e": false, "f": true, "h": 0 }}

CSS Custom Properties

PropertyDescription
--fc-highlight-attr-colorattr color. example: var(--fc-yellow-900), default: var(--fc-orange-900)
--fc-highlight-null-colornull color. example: var(--fc-yellow-900), default: var(--fc-red-600)
--fc-highlight-tag-colortag color. example: var(--fc-yellow-900), default: var(--fc-green-900)
--fc-highlight-value-colorvalue color. example: var(--fc-yellow-900), default: var(--cyan-9)
1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago