Add '1px border <color>' snippets

master
Hektor Misplon 2024-01-30 21:48:10 +01:00
parent 01842d8f1e
commit ac066bb076
Signed by: hektor
GPG Key ID: 5151AF79E723F21C
1 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,20 @@
snippet b1r "Red border (1px)" snippet b1(\w+) "Border (1px)" r
border: 1px solid red; `!p
$0 import re
colors = {
'r': 'red',
'g': 'green',
'b': 'blue',
'y': 'yellow',
'o': 'orange',
'p': 'purple',
'c': 'cyan',
'm': 'magenta',
'w': 'white',
}
color = colors.get(match.group(1), 'black')
snip.rv = f"border: 1px solid {color};"
`$0
endsnippet endsnippet
snippet df "Use flexbox layout" snippet df "Use flexbox layout"