Custom CSS styling

The layout picker and accent color cover most stores. When you need something they do not, you can target any part of the recipe card with your own CSS. This article lists the class names, shows tested examples, and covers what to do when CSS is not enough.

Custom CSS is free on every plan.

Where to add your CSS

For every recipe card on your store

  1. Open Recipe Kit and go to Settings.
  2. Scroll to the bottom of the design card, under Features, and click Custom CSS.
  3. Paste your rules into the field.
  4. Click Save.

The field holds up to 50,000 characters. If Recipe Kit cannot read your CSS, it shows "Not a valid css" and will not save until you fix it.

The Custom CSS field open at the bottom of the design card in Recipe Kit Settings

For one placement only

  1. In Shopify admin, go to Online Store > Themes and click Customize.
  2. Open the template that holds the card, for example Blog posts > Default blog post.
  3. Click the Recipe Kit block.
  4. Under Advanced, paste your rules into Custom CSS.
  5. Click Save.

Rules in the block apply only where that block is placed. They load after the rules from Settings, so they win when both set the same thing.

The Recipe Kit app block settings in the theme editor, with the Custom CSS field under Advanced

Write rules that stick

The card's own styles start with #rk_parent, and a few use !important. A rule that starts with a bare class, such as .rk_heading, loses to them and appears to do nothing.

Start your rules with #rk_parent #rk_design. Two ids beat the card's own rules without needing !important:

#rk_parent #rk_design .rk_heading {
  font-size: 28px;
}

The Add to Cart buttons are the exception. Their background color is set with !important, so your rule needs it too (see Restyle the Add to Cart button below).

Card structure

On the current widget, the card nests like this:

<div id="rk_parent" class="rk_widget_root">
  <div id="rk"></div>
  <div id="rk_design" class="rk_hero_card">
    <div class="rk_container">
      <div class="rk_card">
        <!-- the recipe -->
      </div>
    </div>
  </div>
</div>
Selector What it is
#rk_parent Outermost wrapper. Carries the --design-colour custom property
#rk An empty marker used as a jump target. It does not wrap the card, so rules aimed at #rk change nothing
#rk_design Holds the design class. An id, not a class
.rk_container The card box. Gains .rk_no_border when Card border is off
.rk_card Inner wrapper. Its direct children are the card's main sections

Design classes

The design class sits on #rk_design. Use it to style one design only.

Class on #rk_design Design
.rk_hero_card Hero
.rk_editorial Editorial
.rk_uptown Classic
.rk_sunny Compact
.rk_modern.rk_modern_column Card
.rk_modern.rk_modern_vertical Card Vertical

.rk_modern matches both Card and Card Vertical. To target Card alone, use .rk_modern_column.

The accent color variable

Your accent color is available as a CSS custom property, so you can reuse it inside the card rather than typing a hex value:

#rk_parent #rk_design .rk_description {
  border-left: 3px solid var(--design-colour);
  padding-left: 12px;
}

Header and layout

Selector Element Designs
.rk_hero The large photo block Hero, Editorial
.rk_hero_overlay Title area laid over the photo Hero
.rk_stat_card Panel under the photo with rating, details and description Hero
.rk_panel_top Rating row with Print and Share Hero
.rk_header Header block with title, details and description All except Hero
.rk_image Recipe image Classic, Compact, Card, Card Vertical
.rk_heading Recipe title. Also has the id rk-recipe All
.rk_cuisine_label Cuisine and category label above the title Hero, Editorial
.rk_subheading Author line under the title Classic
.rk_byline Author line under the title Hero
.rk_description Recipe description All
.rk_meta The label of each detail, such as "Prep Time" or "Servings". The value is the paragraph after it All
.rk_controls_bar Row holding Cook Mode, and Print and Share where shown Hero, Editorial
.rk_actions_row Print and Share Hero, Editorial
.rk_actions Column holding Print and Share Classic, Compact, Card, Card Vertical
.rk_grid Grid wrapper, used for the details row on every design All
.rk_primary, .rk_secondary, .rk_details Header grid columns Classic, Compact, Card, Card Vertical
.rk_body Ingredients, equipment and directions. Video, notes, FAQs and nutrition sit outside it All
.rk_sidebar Side column for ingredients (and equipment) Hero, Editorial
.rk_main_col Main column for directions Hero, Editorial
.rk_column A content column All
.rk_column_heading Section headings such as Ingredients and Directions All
.rk_hr Divider line Card, Card Vertical

Ingredients

Selector Element
.rk_ingredients Ingredients section
.rk_ingredients_header Ingredients heading row, with the unit converter when it is on
.rk_ingredients li One ingredient
.rk_group_heading A group heading such as "For the frosting". Also used in directions and equipment
.rk_ingredient_content The text of one ingredient
.rk_has_link An ingredient or equipment link to a product
.rk_shoppable Wrapper around an ingredient linked to a product
.rk_ingredient_thumb Linked product thumbnail

Directions

Selector Element
.rk_directions Directions section
.rk_directions li One step
.rk_direction_content One step's text
.rk_direction_image Step photo
.rk_step_label The tick box label on each step, when Click to check is on

Buttons and cart

Selector Element
.rk_recipe_actions Wrapper around the Print and Share buttons
.rk_action_btn Print or Share button
.rk_print Print button
.rk_share_btn Share button
.rk_share_dialog Share window
.rk_atc_btn Add to Cart button
.rk_rfc_btn Remove from Cart button
.rk_atc_all Add All to Cart button
.rk_cart_actions Row holding Add All to Cart, View Cart and Checkout
.rk_cart_btn View Cart button
.rk_checkout_btn Checkout button
.rk_qty_stepper Quantity stepper
.rk_qty_btn Plus and minus buttons in the stepper

Nutrition

Selector Element
#rk-nutrition Nutrition heading
.rk_nutrition_column Wrapper around the nutrition facts
.rk_nutrition_card Nutrition facts panel
.rk_nutrition_linear, .rk_nutrition_horizontal, .rk_nutrition_vertical The nutrition layout chosen on the recipe

Interactive parts

Selector Element
.rk_rating_wrapper Rating block
.rk_rating Star rating
.rk_checkbox Click to check box
.rk_checked A ticked ingredient or step
.rk-cook-mode-wrapper Cook Mode switch
.rk_serving_adjuster Servings adjuster
.rk_serving_btn Servings plus and minus
.rk_serving_count Current number of servings
.rk_unit_toggle US and metric switch
.rk_unit_btn One option in that switch

When a reader turns Cook Mode on, #rk_parent gains the class .rk-cook-mode-active.

Other sections

Selector Element Designs
.rk_equipment Equipment list All
#rk_video Video section All
.rk_note Recipe notes, and the FAQs block Hero, Editorial
.rk_faqs FAQs block All
.rk_faq_item One question and answer All
.rk_faq_question A question All
.rk_faq_answer An answer All

On Classic, Compact, Card and Card Vertical the notes are a plain .rk_column whose heading has the id rk-notes.

Section ids

Each section heading carries an id you can link to or use in a selector: #rk-recipe (the title), #rk-ingredients, #rk-equipment, #rk-directions, #rk-notes, #rk-video, #rk-faqs and #rk-nutrition. The link inside each heading has the class .rk_anchor_link.

Common changes

Each of these was checked on all six designs.

Set the card width

#rk_parent {
  max-width: 800px;
  margin: 0 auto;
}

Change the font

Use a font your theme already loads, or the reader's browser falls back to its default.

#rk_parent,
#rk_parent * {
  font-family: Georgia, serif;
}

Restyle the title

#rk_parent #rk_design .rk_heading {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

Add lines between ingredients

#rk_parent #rk_design .rk_ingredients li {
  padding: 8px 0;
  border-bottom: 1px dotted #ddd;
}

Restyle the Add to Cart button

The button uses your accent color, so change Accent Color first if that is all you need. To give the button its own color:

#rk_parent #rk_design .rk_atc_btn {
  background: #228b22 !important;
  color: #fff;
  border-radius: 4px;
}

#rk_parent #rk_design .rk_atc_btn:hover {
  background: #1e7a1e !important;
}

Hide something

/* Hide the Print button */
#rk_parent #rk_design .rk_print {
  display: none;
}

/* Hide the nutrition facts and their heading */
#rk_parent #rk-nutrition,
#rk_parent .rk_nutrition_column {
  display: none;
}

/* Hide the video inside the card */
#rk_parent #rk_video {
  display: none;
}

Style one design only

This changes section headings on the Card design and leaves the other five alone:

#rk_parent #rk_design.rk_modern_column .rk_column_heading {
  text-transform: none;
}

Phone-only rules

@media (max-width: 749px) {
  #rk_parent #rk_design .rk_heading {
    font-size: 22px;
  }
}

Hero and Editorial also adjust to the width of the card itself, not only the screen, so check them in a narrow theme column as well as on a phone.

Reorder sections

This moves the video up, between the recipe header and the ingredients, on every design:

#rk_parent #rk_design .rk_card {
  display: flex;
  flex-direction: column;
}

#rk_parent #rk_design.rk_hero_card .rk_card {
  display: grid;
}

#rk_parent #rk_design .rk_card > * {
  order: 3;
}

#rk_parent #rk_design .rk_card > .rk_hero,
#rk_parent #rk_design .rk_card > .rk_header,
#rk_parent #rk_design .rk_card > .rk_stat_card,
#rk_parent #rk_design .rk_card > .rk_controls_bar {
  order: 1;
}

#rk_parent #rk_design .rk_card > #rk_video {
  order: 2;
}

The same pattern moves any of the card's main sections, which are the direct children of .rk_card: #rk_video, .rk_body, #rk-nutrition with .rk_nutrition_column, .rk_faqs, and the notes. Give the section you want higher a lower order number. Ingredients and directions sit inside .rk_body, so they move together.

Change the card in Cook Mode

#rk_parent.rk-cook-mode-active #rk_design .rk_directions li {
  font-size: 24px;
}

Printing

Custom CSS does not reach the print page. When a reader clicks Print, Recipe Kit opens a separate print page with its own layout. Set what it shows under Print page defaults in Settings. See Printing recipes.

On the original widget

If your theme still uses the original pasted-in snippet (recipekit.liquid), the card is built differently. Hero and Editorial do not exist there, and neither do these classes: .rk_recipe_actions, .rk_action_btn, .rk_share_btn, .rk_share_dialog, .rk_qty_stepper, .rk_unit_toggle, .rk_serving_adjuster, .rk_checkbox, .rk_checked, .rk_direction_content, .rk_step_label, .rk_note, .rk_main_col and .rk_cart_actions. #rk_parent and #rk_design are there, so rules built on them still apply to the classes the two widgets share. Upgrading to the new Recipe Kit widget shows how to move over.

Tips

  • Use your browser's element inspector on a live recipe card. It shows exactly which classes are on the element you are looking at.
  • The card renders in the normal page, not in a shadow root or an iframe, so your theme's CSS reaches it too. If a rule does not stick, the card's own rule or your theme's is winning. Check that the rule starts with #rk_parent #rk_design.
  • Switching to another design keeps your custom CSS, but rules scoped to one design class stop matching. Check your rules after switching.

When CSS is not enough

Try the other designs first

Hero, Editorial, Classic, Compact, Card and Card Vertical lay the same recipe out very differently, and switching takes one click under Layout in Settings. Try them against a real recipe before planning anything custom. See Recipe card templates.

Ask us

Email [email protected] with a screenshot or a design reference of what you want. We often make small styling changes and section swaps for you. For larger custom work we can give you a quote, depending on availability. We will tell you honestly whether it is a five-minute CSS snippet or a real project.

Hire a developer

Any developer comfortable with CSS can work from this article with their usual browser tools.

Do not edit the widget files by hand

Older versions of Recipe Kit installed recipekit.liquid and recipekit.scss.liquid into your theme, and some stores edited those files directly. The current widget comes with the app and updates itself, so you get new features and fixes automatically. A theme file edited by hand freezes at the version you edited and misses every fix after it. If you are on a hand-edited copy, move to the current widget with Upgrading to the new Recipe Kit widget, and contact support first if you want help carrying your changes across as CSS.

What's next

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us