File tree Expand file tree Collapse file tree
engine/app/assets/stylesheets/coplan Expand file tree Collapse file tree Original file line number Diff line number Diff line change 241241.deck-slide--title .deck-content h1 ,
242242.deck-slide--title .deck-content h2 ,
243243.deck-slide--title .deck-content h3 {
244+ display : grid;
245+ grid-template-columns : minmax (0 , auto) auto;
246+ align-items : center;
247+ justify-content : start;
244248 font-size : 2.8em ;
245249 line-height : 1.1 ;
246250 letter-spacing : -0.02em ;
256260 display : block;
257261 width : 1.6em ;
258262 height : 0.16em ;
263+ grid-column : 1 / -1 ;
259264 border-radius : 0.08em ;
260265 background : var (--deck-title-accent , var (--deck-accent ));
261266 margin-bottom : 0.55em ;
Original file line number Diff line number Diff line change @@ -118,6 +118,28 @@ def attachments_on_screen?
118118 JS
119119 end
120120
121+ it "keeps the title-slide accent above its aligned section shortcut" do
122+ visit plan_page_path ( plan )
123+ expect ( page ) . to have_css ( ".deck-slide--title .section-permalink" , visible : :all )
124+
125+ layout = page . evaluate_script ( <<~JS )
126+ (() => {
127+ const heading = document.querySelector(".deck-slide--title .section-heading")
128+ const title = heading.querySelector(".section-heading__title").getBoundingClientRect()
129+ const link = heading.querySelector(".section-permalink").getBoundingClientRect()
130+ const accent = getComputedStyle(heading, "::before")
131+ return {
132+ display: getComputedStyle(heading).display,
133+ accentColumn: `${accent.gridColumnStart} / ${accent.gridColumnEnd}`,
134+ centerDelta: Math.abs((title.top + title.bottom - link.top - link.bottom) / 2)
135+ }
136+ })()
137+ JS
138+
139+ expect ( layout ) . to include ( "display" => "grid" , "accentColumn" => "1 / -1" )
140+ expect ( layout [ "centerDelta" ] ) . to be < 1
141+ end
142+
121143 describe "present mode" do
122144 it "treats a drag as a highlight and a bare click as the next slide" do
123145 visit plan_page_path ( plan )
You can’t perform that action at this time.
0 commit comments