import os with open('src/main/resources/static/css/custom.css', 'r') as f: css = f.read() # Replace max-width: fit-content with max-width: 100% or remove it css = css.replace("max-width: fit-content;", "max-width: 860px;") # 860px is the width in their snippet, but 100% is better. # In their snippet they have a parent
# But the parent's width might not be constrained. # Let's change max-width: fit-content to width: 100% and max-width: 860px; css = css.replace("max-width: fit-content;", "max-width: 860px;") with open('src/main/resources/static/css/custom.css', 'w') as f: f.write(css) print("Updated custom.css for full width")