-
Notifications
You must be signed in to change notification settings - Fork 230
Refine getting-started docs typography and preview styling #1818
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1699,6 +1699,14 @@ | |
| /* padding: 0rem 0.125rem 0rem 0.125rem; */ | ||
| } | ||
|
|
||
| /* Override Radix Code (rt-Code) accent coloring so inline code matches slate theme */ | ||
| code.rt-Code, | ||
| code.rt-Code.rt-variant-soft, | ||
| .rt-Code.rt-variant-soft { | ||
| color: var(--c-slate-11) !important; | ||
| background-color: var(--c-slate-3) !important; | ||
| } | ||
|
|
||
| .code-error-style { | ||
| font-family: var(--font-jetbrains); | ||
| font-size: 0.835rem; | ||
|
|
@@ -1803,6 +1811,44 @@ | |
| } | ||
| } | ||
|
|
||
| .code-block button, | ||
| .code-block > button { | ||
| border: none !important; | ||
| border-width: 0 !important; | ||
| background: transparent !important; | ||
| background-color: transparent !important; | ||
| opacity: 0 !important; | ||
| transition: opacity 0.15s ease-out !important; | ||
| pointer-events: none; | ||
| display: inline-flex !important; | ||
| align-items: center !important; | ||
| gap: 0.375rem !important; | ||
| font-size: 0.8125rem !important; | ||
| font-weight: 500 !important; | ||
| color: var(--c-slate-11) !important; | ||
| top: 8px !important; | ||
| right: 12px !important; | ||
| padding: 6px 8px !important; | ||
| } | ||
|
|
||
| .code-block button::after, | ||
| .code-block > button::after { | ||
| content: "Copy"; | ||
| } | ||
|
|
||
| .code-block:hover button, | ||
| .code-block:hover > button, | ||
| .code-block button:focus-visible { | ||
| opacity: 1 !important; | ||
| pointer-events: auto; | ||
|
Comment on lines
+1822
to
+1843
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Every adjacent property in this block uses Add |
||
| } | ||
|
|
||
| .code-block button:hover, | ||
| .code-block > button:hover { | ||
| background: var(--c-slate-3) !important; | ||
| background-color: var(--c-slate-3) !important; | ||
| } | ||
|
|
||
|
|
||
| .tab-style { | ||
| color: var(--c-slate-9); | ||
|
|
@@ -1814,6 +1860,89 @@ | |
| letter-spacing: -0.01094rem; | ||
| } | ||
|
|
||
| .pill-tab-list { | ||
| display: inline-flex !important; | ||
| gap: 2px !important; | ||
| padding: 4px !important; | ||
| background: var(--c-slate-3) !important; | ||
| border-radius: 10px !important; | ||
| border-bottom: none !important; | ||
| box-shadow: none !important; | ||
| width: fit-content !important; | ||
| max-width: 100%; | ||
| overflow-x: auto; | ||
| } | ||
|
|
||
| .pill-tab-list::before, | ||
| .pill-tab-list::after { | ||
| display: none !important; | ||
| content: none !important; | ||
| } | ||
|
|
||
| .pill-tab { | ||
| appearance: none !important; | ||
| background: transparent !important; | ||
| background-color: transparent !important; | ||
| border: none !important; | ||
| padding: 8px 16px !important; | ||
| font-size: 0.9375rem !important; | ||
| font-weight: 450 !important; | ||
| color: var(--c-slate-11) !important; | ||
| border-radius: 7px !important; | ||
| cursor: pointer; | ||
| white-space: nowrap; | ||
| transition: color 0.12s, background-color 0.12s, box-shadow 0.12s; | ||
| letter-spacing: 0 !important; | ||
| line-height: 1.25rem !important; | ||
| box-shadow: none !important; | ||
| } | ||
|
|
||
| .pill-tab::before, | ||
| .pill-tab::after, | ||
| .pill-tab:hover::before, | ||
| .pill-tab:hover::after, | ||
| .pill-tab[data-state='active']::before, | ||
| .pill-tab[data-state='active']::after, | ||
| .pill-tab[data-state='active']:hover::before, | ||
| .pill-tab[data-state='active']:hover::after { | ||
| background: transparent !important; | ||
| background-color: transparent !important; | ||
| box-shadow: none !important; | ||
| content: none !important; | ||
| display: none !important; | ||
| } | ||
|
|
||
| .pill-tab:hover { | ||
| color: var(--c-slate-11) !important; | ||
| background: transparent !important; | ||
| } | ||
|
|
||
| .pill-tab .rt-BaseTabListTriggerInner, | ||
| .pill-tab:hover .rt-BaseTabListTriggerInner, | ||
| .pill-tab:focus-visible .rt-BaseTabListTriggerInner, | ||
| .pill-tab:focus-visible:hover .rt-BaseTabListTriggerInner { | ||
| background-color: transparent !important; | ||
| background: transparent !important; | ||
| } | ||
|
|
||
| .pill-tab[data-state='active'], | ||
| .pill-tab[data-state='active']:hover { | ||
| color: var(--c-slate-12) !important; | ||
| font-weight: 500 !important; | ||
| background: var(--c-slate-1) !important; | ||
| background-color: var(--c-slate-1) !important; | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important; | ||
| } | ||
|
|
||
| :where(.dark, .dark *) .pill-tab[data-state='active'] { | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important; | ||
| } | ||
|
|
||
| .tab-style:hover:not([data-state='active'])::before { | ||
| background: transparent !important; | ||
| background-color: transparent !important; | ||
| } | ||
|
|
||
| .tab-style:hover { | ||
| color: var(--c-slate-11); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -153,35 +153,20 @@ def render(self, env) -> rx.Component: | |||||||||||||||||
| for i in range(len(header_indices) - 1) | ||||||||||||||||||
| ] | ||||||||||||||||||
|
|
||||||||||||||||||
| return rx.box( | ||||||||||||||||||
| rx.vstack( | ||||||||||||||||||
| *[ | ||||||||||||||||||
| rx.fragment( | ||||||||||||||||||
| rx.text( | ||||||||||||||||||
| rx.text.span( | ||||||||||||||||||
| header, | ||||||||||||||||||
| font_weight="bold", | ||||||||||||||||||
| ), | ||||||||||||||||||
| width="100%", | ||||||||||||||||||
| ), | ||||||||||||||||||
| rx.box( | ||||||||||||||||||
| markdown(section), | ||||||||||||||||||
| width="100%", | ||||||||||||||||||
| ), | ||||||||||||||||||
| ) | ||||||||||||||||||
| for header, section in sections | ||||||||||||||||||
| ], | ||||||||||||||||||
| text_align="left", | ||||||||||||||||||
| margin_y="1em", | ||||||||||||||||||
| width="100%", | ||||||||||||||||||
| ), | ||||||||||||||||||
| border_left=f"1.5px {c_color('slate', 4)} solid", | ||||||||||||||||||
| padding_left="1em", | ||||||||||||||||||
| width="100%", | ||||||||||||||||||
| align_items="center", | ||||||||||||||||||
| return rx.el.div( | ||||||||||||||||||
| *[ | ||||||||||||||||||
| rx.el.div( | ||||||||||||||||||
| rx.el.div(header, class_name="font-bold text-slate-12"), | ||||||||||||||||||
| rx.el.div(markdown(section), class_name="w-full"), | ||||||||||||||||||
| class_name="flex flex-col gap-1 w-full", | ||||||||||||||||||
| ) | ||||||||||||||||||
| for header, section in sections | ||||||||||||||||||
| ], | ||||||||||||||||||
| class_name="flex flex-col gap-6 w-full my-4 pl-6 border-l border-slate-4", | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| class DefinitionBlock(flexdown.blocks.Block): | ||||||||||||||||||
|
Comment on lines
167
to
170
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Three blank lines between top-level class definitions violates PEP 8's E303 rule (max 2 allowed), which Ruff enforces. This will cause
Suggested change
|
||||||||||||||||||
| starting_indicator = "```md definition" | ||||||||||||||||||
| ending_indicator = "```" | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top/rightoffsets are inert withoutpositiontop: 8pxandright: 12pxonly take effect on positioned elements (absolute,fixed,sticky, orrelative). Nopositionproperty is set anywhere on.code-block buttonin this stylesheet, so these values will be silently ignored unless Reflex's library CSS already appliesposition: absoluteto the copy button. If that guarantee doesn't hold, the button won't be correctly pinned to the top-right corner of the code block.