This is a framework built by me to easily be able to recreate styles and functions when building websites, and also to improve my skills. The framework is built with SASS and Angular 1, and made to be as flexible as possible for use in future projects. You can find the GitHub-repository for the project here.
Because of Angular this framework only works in Internet Explorer 9 or later browsers. All animations are made with CSS3 and might not work correctly in older browsers.
I have made two example pages with the framework for now. They are both one-page websites with similar structure but different themes.
The icon library is under construction. Currently these icons are at your disposal. The icons are displayed with a font made with Icomoon and are completely original. Since they are a font, they can be styled as text with color, shadows and font-size. To include an icon, add an empty i-element with the class-name displayed under the icon you want to use.
icon-asterisk
icon-check
icon-chevron_down_light
icon-chevron_left_light
icon-chevron_right_light
icon-chevron_up_light
icon-close
icon-globe
icon-heart
icon-help
icon-profile1
icon-profile2
icon-search
icon-star
icon-warning_circle
icon-warning_triangle
Add the class underline to your list for a different style.
Add the class round to your list to show the numbers in circles.
Table Header | Another Header | A Third One |
---|---|---|
Footer content | ||
Data | More Data | Even more |
Data | More Data | Even more |
Data | More Data | Even more |
Inputs and Textareas are created with the <form-section>-element. You need to define whether it's an input or textarea you want with the field-attribute. You can use most of the attributes you normally would on an their respective tags, such as type, disabled or placeholder. You can also use most of the Angular-specific attributes for inputs, for example ng-model or validation. Note that validation will only work if your input is inside of a form-element with a name-attribute on it, or an element with the ng-form-attribute. Other attributes you can use are:
To make styling of these elements possible in the first place some CSS "hacks" are required. It is therefore recommended to start with these predefined directives and style them on your own from there if required. Instead of creating input-elements with different types you can now use the <radio-button> and <checkbox> elements. You can use the checked and disabled-attributes on these elements as you normally would, and they also work with ng-model.
You can use either regular select-elements (to the right) or the custom ones built for this Framework. Instead of select, you use the <dropdown>-element. The dropdown-element simulates a menu through lists, which allows for extensive styling and looks the same across different browsers, but it also contains a hidden regular select with all the values you might need for a form. You can use multiple or disabled as on a regular select-element.
This is a flexible grid system built upon Flexbox. This means it is only fully functional in browsers later than Internet Explorer 9. A Fallback solution is planned but not implemented. Simply create a row-element, and then populate it with column-elements. If you need it to take up a certain amount of width, add any number between one and twelve as an attribute. Twelve fills the entire row. If the total number of columns is higher than twelve, the columns will automatically be contained to that row rather than keep their intended width.
If, however, you don't provide the columns with a number, they will adjust according to their content.
For easy ability to make a video embed responsive, surround your embed with a div of the class video-wrapper. The video will never take up more than the width of it's container.
Use these classes for easy alignment of text.
text-left
text-center
text-right
You can use the mute-class for a more discrete color.
Use the big-class for a bigger font.
Use the normal-class for the original fontsize.
Use the small-class for a smaller font.
Add this class to a wrapping element to set a maximum width for your content. The width is determined in theme.scss.
Add the inline, inline-block or block class to an element to easily display it as such.
Each section on this row uses the card-class. This class adds a thin border around your content to separate it from the rest of the page.
Add the thumbnail-class to an image for a discrete frame.
Use primary-bg, secondary-bg, contrast-bg or invert-bg to add a background with the theme colors to your element.
primary-bg
secondary-bg
contrast-bg
invert-bg
This class adds a span element around every word within it. Be sure to use it only when the element contains nothing but text. Each span gets the class color-span, found in _helpers.scss and can be styled through that.
Adds a background color to your element and calculates a readable text color for it. Supply the $color.
Makes the element a circle. You can specify $width and $height, but if you don't the circle will be responsive and take up the width of the parent.
Include this mixin to create a solid colored arrow on your containing element. Include the mixin in a pseudo class in your container, either before or after. This allows you to use up to two different arrows per element. The container needs to have position:relative.
up
down
left
right
up inverse
down inverse
left inverse
right inverse
before:up after:down
before: left inverse
after: right inverse
before: left pos:15px
after: up pos:80%
before: left
after: left inverse
If you're looking to make an inverse arrow please use the colorArrow mixin. However, if you are looking to create an arrow from a container with a background image, this is the mixin you should use. It's not as flexible and should not be included in a pseudo-class, it should rather be included in the containing element itself. Currently the arrow can only appear in the middle.
arrow-image up
arrow-image down
arrow-image left
arrow-image right
To get a fully slanted container include the slant-mixin. Insert your content into a div with the class content inside of your container for the content not to skew. To automatically surround everything within the container with the content-class, add the class slanted to your container. You can include the mixin in a class called slanted to make it simple.
slant y 2
slant y -2
slant x 2
slant x -2
To add a skewed edge in a solid color, include slantEdge in a pseudo class of your container, either before or after. This allows you to combine up to two different edges per element. The container needs to have position:relative.
top
bottom
left
right
before: left reverse
after: bottom
before: top 5
after: top 5 reverse
To add a skewed edge to a container with a background image, include slantImage directly in the container. Since some rules for the container are very important, the pseudo-class is instead determined by the parameters you enter.
top
bottom
right
left reverse
right 10 before
left 10 after
top 10 before
bottom 10 after
To add a fade to an edge, include fade.
all
top
bottom
left
right
Style several headings at once using the headings-mixin. Specify from and to which number the rules should apply as parameters. @include headings(1, 3){color:red;}
for example would apply red to h1 through h3.
Include lineThrough to get the effect of a line running behind your text. This will only work for text on one line.
Include this mixin on an element to make it appear as a ribbon in the corner of its parent. The parent should have position: relative and probably overflow: hidden.
top left
Example Text
top right
Example Text
bottom left
Example Text
bottom right
Example Text
There are several types of ready-made image galleries available. The common thing for each of them is that they require and image-attribute, where you supply an array of image-objects. Each object should have the properties src (the image source) and alt (alternative text for the image). You can also supply desc as a property, for a description of the image to show up along with it.
This is a standard gallery created with the tag modal-gallery. It will show all the images supplied in cropped divs, and if you click on a picture it's displayed in a modal. Five pictures will be shown on each row in desktop, and two on mobile.
This gallery is created with the tag slide-gallery. You can provide a number to the attribute previews to determine how many preview images should be shown at the bottom. This gallery does not open a modal, instead it previews the picture selected above the previews. You can also browse the previews by using the arrow buttons next to them.
This gallery is created with the tag masonry-gallery. Inspired by the popular masonry-layout, this gallery adds each image to a set width column and pile the images on top of each other despite orientation. You can add the attribute columns with a number, which will determine how many columns it will be split up into, default is three.
To create a carousel, use the carousel-tag. Then treat it like a list, where each li is a slide, containing whatever content and styling you like. Default height of the carousel is 350px, which can be overriden in CSS. You can add the attribute interval and provide how many milliseconds each slide should last, default is 5000.
This is a paragraph.
To create a modal, simply use the element modal with a show-attribute. When the value of show evaluates to true, the modal will be displayed. The modal will appear on top of any other content and put an overlay above the rest of the site. It's a box which inherits your theme colors and adds some padding and a close button, and then displays your content within.
In sagittis feugiat tortor vitae porta. Nam facilisis, augue vel bibendum sagittis, est eros fermentum metus, porta tempor dui lacus in metus. Vestibulum vehicula at purus vel sollicitudin. Ut eget ipsum quis quam faucibus tristique quis eu velit. Nullam erat neque, lacinia porttitor egestas ut, bibendum id mi. Aliquam ac orci non ligula mollis condimentum. Pellentesque efficitur eros quam, nec bibendum ante sodales eget.