Skip to content

Commit

Permalink
Merge pull request #92 from posit-dev/css-fix-p-element
Browse files Browse the repository at this point in the history
Ensure that ID value in compiled CSS is applied to all rules
  • Loading branch information
rich-iannone authored Dec 15, 2023
2 parents 47afe0f + 07a546b commit 4817e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion great_tables/_scss.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def compile_scss(data: GTData, id: Optional[str], compress: bool = True) -> str:
if has_id:
compiled_css = re.sub(r"\.gt_", f"#{id} .gt_", compiled_css, 0, re.MULTILINE)
compiled_css = re.sub(r"thead", f"#{id} thead", compiled_css, 0, re.MULTILINE)
compiled_css = re.sub(r"^p \{", f"#{id} p " + "{", compiled_css, 0, re.MULTILINE)
compiled_css = re.sub(r"^( p|p) \{", f"#{id} p {{", compiled_css, 0, re.MULTILINE)

finalized_css = f"{gt_table_class_str}\n\n{compiled_css}"

Expand Down

0 comments on commit 4817e12

Please sign in to comment.