How to use the frontity.styled.div function in frontity

To help you get started, weโ€™ve selected a few frontity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frontity / frontity / packages / twenty-twenty-theme / src / components / header.js View on Github external
{/* Desktop navigation links */}
          
          {/* Desktop search button */}
          {state.theme.showSearchInHeader && }
        
      
      {/* Global search modal */}
      
    
  );
};

// Connect the Header component to get access to the `state` in it's `props`
export default connect(Header);

const TitleGroup = styled.div`
  @media (min-width: 1000px) {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: -1rem 0 0 -2.4rem;
  }
`;

const TitleWrapper = styled.div`
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 0 4rem;
  text-align: center;
  width: 100%;
github frontity / frontity / packages / twentytwenty-theme / src / components / styles / section-container.js View on Github external
import { styled } from "frontity";

// Header sizes bases on style.css
const maxWidths = {
  thin: "58rem",
  small: "80rem",
  medium: "100rem"
};

const getMaxWidth = props => maxWidths[props.size] || maxWidths["medium"];

const SectionContainer = styled.div`
  margin-left: auto;
  margin-right: auto;
  width: calc(100% - 4rem);
  max-width: ${getMaxWidth};

  @media (min-width: 700px) {
    width: calc(100% - 8rem);
  }
`;

export default SectionContainer;
github frontity / frontity / packages / mars-theme / src / components / list / list-item.js View on Github external
const AuthorName = styled.span`
  color: rgba(12, 17, 43, 0.9);
  font-size: 0.9em;
`;

const StyledLink = styled(Link)`
  padding: 15px 0;
`;

const PublishDate = styled.span`
  color: rgba(12, 17, 43, 0.9);
  font-size: 0.9em;
`;

const Excerpt = styled.div`
  line-height: 1.6em;
  color: rgba(12, 17, 43, 0.8);
`;
github frontity / frontity / packages / twenty-twenty-theme / src / components / search / search-button.js View on Github external
);
};

export default connect(SearchButton);

const HeaderToggle = styled.div`
  display: none;

  @media (min-width: 1000px) {
    display: flex;
    flex-shrink: 0;
    margin-right: -3rem;
    margin-left: 3rem;
  }

  @media (min-width: 1220px) {
    margin-right: -4rem;
    margin-left: 4rem;
  }
`;
github goiblas / personal-blog / packages / goiblas-blog / src / components / header / theme-switcher.js View on Github external
return (
        
    );
};

export default connect(ThemeSwitcher);

const Switch = styled.div`
    overflow: hidden;
    border-radius: 3px;
    box-shadow: inset var(--color-border) 0 0 0 1px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 90px;

    button {
        border: 0;
        background-color: transparent;
        height: 36px;
        display: flex;
        outline: 0;

        svg {
            margin: auto;
github frontity / frontity / packages / mars-theme / src / components / menu-modal.js View on Github external
{isThereLinks &&
          menu.map(([name, link]) => (
            
              {name}
            
          ))}
      
    
  );
};

const MenuOverlay = styled.div`
  background-color: #1f38c5;
  width: 100vw;
  height: 100vh;
  overflow: hidden auto;
  position: fixed;
  z-index: 2;
  top: 0;
  left: 0;
`;

const MenuContent = styled.div`
  z-index: 3;
`;

const MenuLink = styled(Link)`
  width: 100%;
github frontity / frontity / packages / twentytwenty-theme / src / components / post / post-item.js View on Github external
color: #000000;
  text-decoration: none;
  display: inline-block;
  &:hover {
    text-decoration: underline;
  }
`;

export const PostInner = styled(SectionContainer)`
  padding-top: 5rem;
  @media (min-width: 700px) {
    padding-top: 8rem;
  }
`;

export const EntryContent = styled.div`
  line-height: 1.5;
  max-width: 58rem;
  font-family: "Hoefler Text", Garamond, "Times New Roman", serif;
  letter-spacing: normal;

  @media (min-width: 700px) {
    font-size: 2.1rem;
  }

  > *:first-of-type {
    margin-top: 0;
  }

  figure {
    margin: 2em 0;
    max-width: 100%;
github frontity / frontity / packages / twenty-twenty-theme / src / components / search-modal.js View on Github external
position: fixed;
  bottom: 0;
  left: -9999rem;
  top: 0;
  transition: opacity 0.2s linear, left 0s 0.2s linear;
  width: 100%;
  z-index: 999;

  &[data-open="true"] {
    display: block;
    opacity: 1;
    left: 0;
  }
`;

const ModalInner = styled.div`
  box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.08);
  transform: translateY(0);
  background: #fff;
  transition: transform 0.25s ease-in-out, box-shadow 0.1s 0.25s linear;
  cursor: default;
`;

const SectionInner = styled.div`
  margin-left: auto;
  margin-right: auto;
  max-width: 120rem;
  width: calc(100% - 4rem);
  display: flex;
  justify-content: space-between;
  max-width: 168rem;
github frontity / frontity / packages / twentytwenty-theme / src / components / post / post-categories.js View on Github external
Categories

      
        {postCategories.map(category => (
          
            {category.name}
          
        ))}
      
    
  );
};

export default connect(PostCategories);

const EntryCategories = styled.div`
  line-height: 1.25;
  margin-bottom: 2rem;

  @media (min-width: 700px) {
    margin-bottom: 3rem;
  }
`;

const EntryCategoriesInner = styled.div`
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  margin: -0.5rem 0 0 -1rem;

  @media (min-width: 700px) {
    margin: -1rem 0 0 -2rem;
github goiblas / personal-blog / packages / mars-theme / src / components / code.js View on Github external
<div>
            
                
                    {props.children}
                
            
        </div>
      );
}

export default ContentPre;

const getLanguage = (classes = 'brush: text;') =&gt; {
    return classes.match((/brush: (\w+);/))[1];
}
const Container = styled.div`
    --margin-library: 0.5em;
    margin: calc(var(--space) - var(--margin-library)) calc(var(--margin-library) * -1);
    overflow: auto;

    pre {
        border-radius: 3px;
    }
`;