Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from pathlib import Path
|
|
7 |
st.title("HTML to Twig and SCSS Converter")
|
8 |
|
9 |
# Functions to parse variables and convert CSS to SCSS
|
|
|
10 |
def parse_variable_file(variable_content):
|
11 |
"""Parses the SCSS variable content and returns a mapping of color names to their values."""
|
12 |
variables = {}
|
@@ -17,6 +18,7 @@ def parse_variable_file(variable_content):
|
|
17 |
variables[match.group(2)] = f"${match.group(1)}" # Color value as key, variable name as value
|
18 |
return variables
|
19 |
|
|
|
20 |
def convert_css_to_scss(css_content, variable_mapping):
|
21 |
"""Converts CSS content to SCSS by replacing color values with variable names."""
|
22 |
for color, variable in variable_mapping.items():
|
|
|
7 |
st.title("HTML to Twig and SCSS Converter")
|
8 |
|
9 |
# Functions to parse variables and convert CSS to SCSS
|
10 |
+
|
11 |
def parse_variable_file(variable_content):
|
12 |
"""Parses the SCSS variable content and returns a mapping of color names to their values."""
|
13 |
variables = {}
|
|
|
18 |
variables[match.group(2)] = f"${match.group(1)}" # Color value as key, variable name as value
|
19 |
return variables
|
20 |
|
21 |
+
|
22 |
def convert_css_to_scss(css_content, variable_mapping):
|
23 |
"""Converts CSS content to SCSS by replacing color values with variable names."""
|
24 |
for color, variable in variable_mapping.items():
|