mirror of https://gitlab.com/bashrc2/epicyon
Add flag to replace once only
parent
1052ea8a45
commit
c07a8192f9
6
theme.py
6
theme.py
|
@ -67,9 +67,11 @@ def setCSSparam(css: str, param: str, value: str) -> str:
|
||||||
if param.startswith('rgba('):
|
if param.startswith('rgba('):
|
||||||
return css.replace(param, value)
|
return css.replace(param, value)
|
||||||
# if the parameter begins with * then don't prepend --
|
# if the parameter begins with * then don't prepend --
|
||||||
|
onceOnly = False
|
||||||
if param.startswith('*'):
|
if param.startswith('*'):
|
||||||
if param.startswith('**'):
|
if param.startswith('**'):
|
||||||
searchStr = param.replace('**', '', 1) + ':'
|
onceOnly = True
|
||||||
|
searchStr = param.replace('**', '') + ':'
|
||||||
else:
|
else:
|
||||||
searchStr = param.replace('*', '') + ':'
|
searchStr = param.replace('*', '') + ':'
|
||||||
else:
|
else:
|
||||||
|
@ -90,6 +92,8 @@ def setCSSparam(css: str, param: str, value: str) -> str:
|
||||||
searchStr + ' ' + value + ';' + sectionStr.split(';', 1)[1]
|
searchStr + ' ' + value + ';' + sectionStr.split(';', 1)[1]
|
||||||
else:
|
else:
|
||||||
newcss += searchStr + ' ' + sectionStr
|
newcss += searchStr + ' ' + sectionStr
|
||||||
|
if onceOnly:
|
||||||
|
break
|
||||||
return newcss.strip()
|
return newcss.strip()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue