mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-05 22:07:10 -04:00
feat(new tool): CSS Prettier
CSS Prettier
This commit is contained in:
parent
21fa7217ad
commit
a7dd50331a
3 changed files with 51 additions and 0 deletions
37
src/tools/css-prettifier/css-prettifier.vue
Normal file
37
src/tools/css-prettifier/css-prettifier.vue
Normal file
|
@ -0,0 +1,37 @@
|
|||
<script setup lang="ts">
|
||||
import beautify from 'js-beautify';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const inputCSS = ref('');
|
||||
const outputCSS = computed(() => {
|
||||
return beautify.css(inputCSS.value, {
|
||||
indent_char: ' ',
|
||||
indent_size: 2,
|
||||
sep: '\n',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputCSS"
|
||||
multiline raw-text
|
||||
placeholder="Your CSS content..."
|
||||
rows="8"
|
||||
autofocus
|
||||
label="Your CSS to format (can paste from clipboard):"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Output prettified CSS:">
|
||||
<TextareaCopyable
|
||||
:value="outputCSS"
|
||||
multiline
|
||||
language="css"
|
||||
word-wrap
|
||||
/>
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue