Skip to content

Commit

Permalink
Process eval-ruby before include-in-header
Browse files Browse the repository at this point in the history
I'm playing with some page specific CSS. The order of processing
matters.

My source looks like this.

```
<eval-ruby>
  <include-in-header>
    <style>/* earlier in the cascade */</style>
  </include-in-header>
</eval-ruby>
```

<include-in-header>
  <style>/* later in the cascade */</style>
</include-in-header>
```

The end result with the previous solution was:

```
<head>
  <style>/* later in the cascade */</style>
  <style>/* earlier in the cascade */</style>
</head>
```

The end result with the new solution becomes:

```
<head>
  <style>/* earlier in the cascade */</style>
  <style>/* later in the cascade */</style>
</head>
```

Which is the desired order for declarative markup and the importance of
order when defining the CSS cascade.
  • Loading branch information
danott committed Mar 3, 2024
1 parent 739e796 commit 4b3622b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/magic_element_hydrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def hydrate
end

def next_magic_element
IncludeInHeader.recognize(content) || EvalRuby.recognize(content, self)
EvalRuby.recognize(content, self) || IncludeInHeader.recognize(content)
end

def next
Expand Down

0 comments on commit 4b3622b

Please sign in to comment.